3

I'm implementing schemas for financial information (using JSON-LD), in this case mortgage loans.

The example on the bottom of the documentation site https://schema.org/MortgageLoan shows how to implement this for a specific loan, however I'm not quite sure of how to modify the graph when I have several mortgage loans, each with a different loanTerm and interestRate. Should I just repeat this whole block for each loan? Or can I nest each mortgage loan under this @type somehow?

The information I want to convey is that a loan can have different loan terms, which will have different interest rates.

I could put the different rates and terms as nested objects under each label, but then there is seems to be no relation between the two.

How should I do this? This is some example code of what I have.

{
    "@context": "http://schema.org",
    "@type": "MortgageLoan",
    "name": "A name of this loan...",
    "loanType": "A type of loan...",
    "description": "A description...",
    "interestRate": [
        {
        "@type":"QuantitativeValue",
        "name":"Rate",
        "value": "3",
        "unitCode": "P1"
        }
    ],
    "loanTerm": {
        "@type": "QuantitativeValue",
        "name": "Binding period",
        "value": 12,
        "uniTtext": "months"
    }
}

1 Answer 1

2

You have to provide multiple MortgageLoan items.

Why? Even if multiple interestRate values would represent alternatives (which, probably, isn’t the case), there is no way to convey which interestRate value belongs to which loanTerm value. So, multiple interestRate and loanTerm values would all apply.

How to provide multiple MortgageLoan items? You can either provide one script element per MortgageLoan item, or you can have one script element with @graph that lists all MortgageLoan items (see the two examples in the section "As top-level items").

1
  • Yes that is exactly the problem I was thinking about, there is no relation between the interestRate and the loanTerm if you don't provide multiple items somehow. I will do as you suggest, thanks a lot!
    – Johan Dahl
    Aug 14, 2019 at 10:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.