-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement JSON-LD Integration Across Services #844
Comments
Murm Services currently takes in data from the following sources:
That data is then transformed into JSON format and validated against the schema(s) linked to it, and then stored in the dataproxy. For example, using the people_schema-v0.1.0 schema, the following data:
... would be transformed into the following JSON: {
"linked_schemas": ["people_schema-v0.1.0"],
"name": "Geoff Turk",
"geolocation": {
"lat": 48.88111,
"lon": 2.38296
}
} ... and validated against the schema. We want to take that JSON output of the profile and transform it into JSON-LD format: {
"@context": "https://library.murmurations.network/jsonld/people_schema.jsonld",
"@type": "Person",
"name": "Geoff Turk",
"geolocation": {
"@type": "GeoCoordinates",
"lat": 48.88111,
"lon": 2.38296
},
"linked_schemas": ["people_schema-v0.1.0"]
} Rather than repeatedly including the JSON-LD context in each profile, we want to link to the context from the library. https://library.murmurations.network/jsonld/people_schema.jsonld {
"@context": {
"@vocab": "https://schema.org/",
"murm": "https://murmurations.network/ns/",
"name": "name",
"geolocation": "location",
"lat": "latitude",
"lon": "longitude",
"linked_schemas": "murm:linkedSchemas"
}
} Note the above context is just an example. The full context still needs to be mapped out and added to the library. One thing to point out is that the To work around this, we can embed the type in the metadata of the schema or field that requires a {
"metadata": {
"@type": "Person",
"@context": "https://library.murmurations.network/jsonld/people_schema.jsonld",
"schema": {
"name": "people_schema-v0.1.0",
... etc ...
}
}
} And the geolocation field can be declared as: {
"metadata": {
"@type": "GeoCoordinates",
"field": {
"name": "geolocation",
"version": "1.0.0"
},
... etc ...
}
} There would need to be a preprocessing step to add the This is just one possible way to implement the JSON-LD transformation. It's worth exploring other options to see if there are any better approaches. |
Based on the discussed content, the designed steps are as follows:
|
Question: If schema.org doesn’t provide the fields we need, such as We will need to add a
|
My current thinking is that we should separate the context from validation, so yes, we should create a separate repo for context-related info, which can be deployed independently from changes to validation parameters. I'll set this up once I get feedback from @olisb on what to name it (either with a third level domain or something in the path of the root domain). |
Library Service:
Index Service:
DataProxy Services:
The text was updated successfully, but these errors were encountered: