0

I am working on FlashCards app and I want to use json-ld for importing/exporting data from the app. I created simple structure but I am not sure if what I have done is valid and the links between the data are properly set.

  1. I am not sure if the link between FlashCardSide:language and Dictionary:availableLanguage is created
  2. FlashCard is of type Thing, and I have FlashCard:contains which is supposed to be not valid property, still validation passes.
  3. How should I define the types and properties that are not from schema.org ex:Dictionary, ex:FlashCardSide,
  4. Should I put some json-ld definitions on the site. something like https://example.com/ontology.jsonld
  5. How should acceptedValue be defined

Here is sample of the json-ld:

{
  "@context": {
    "ex": "https://example.com/",
    "schema": "http://schema.org/",
    "id": "@id",
    "type": "@type",
    "Dictionary": "ex:Dictionary",
    "Language": "schema:Language",
    "FlashCard": "schema:Thing",
    "FlashCardSide": "ex:FlashCardSide",
    "availableLanguage": "schema:availableLanguage",
    "name": "schema:name",
    "value": "schema:value",
    "description": "schema:description",
    "isPartOf": "schema:isPartOf",
    "itemListElement": "schema:itemListElement"
  },
  "id": "ex:dictionary/0117649e-f5af-486e-9d4d-756c335f7e53",
  "type": "Dictionary",
  "availableLanguage": [
    {
      "id": "ex:language/norwegian",
      "type": "Language",
      "name": "norsk"
    },
    {
      "id": "ex:language/english",
      "type": "Language",
      "name": "english"
    }
  ],
  "itemListElement": [
    {
      "id": "ex:flashcard/0117649e-f5af-486e-9d4d-756c335f7e51",
      "type": "FlashCard",
      "contains": [
        {
          "type": "FlashCardSide",
          "value": "hund",
          "isPartOf": "ex:language/norwegian",
          "acceptedValue": ["random-123"],
          "description": "<p>additional details</p>"
        },
        {
          "type": "FlashCardSide",
          "value": "dog",
          "isPartOf": "ex:language/english",
          "acceptedValue": ["random-123"],
          "description": "<p>additional details</p>"
        }
      ]
    },
    {
      "id": "ex:flashcard/0117649e-f5af-486e-9d4d-756c335f7e52",
      "type": "FlashCard",
      "contains": [
        {
          "type": "FlashCardSide",
          "value": "eple",
          "isPartOf": "ex:language/norwegian",
          "acceptedValue": ["random-321"],
          "description": "<p>additional details</p>"
        },
        {
          "type": "FlashCardSide",
          "value": "apple",
          "isPartOf": "ex:language/english",
          "acceptedValue": ["random-321"],
          "description": "<p>additional details</p>"
        }
      ]
    }
  ]
}

I have tested it with both: https://validator.schema.org/ and https://json-ld.org/playground/ and it appears to be valid.

3
  • Have you tried visualizing the data in a graph database? Commented Mar 31, 2024 at 22:53
  • I have not. What tools I can use to visualize it? Commented Apr 1, 2024 at 17:24
  • Ontotext's GraphDB, Stardog, TerminusDB, etc (look up rdf graph database). You can also use networkx to load RDF and display it. Commented Apr 1, 2024 at 22:11

0

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.