Converting JSON-LD Smart Data Models to RDF/Turtle File Ontology
Max-Bld opened this issue · 4 comments
Hello,
I am trying to experiment with Smart Data Models in order to add a common semantic layer to multiple heterogeneous data sources.
For this purpose, I would like to translate the JSON-LD file to a .ttl (RDF serialization) file ontology in order to explore and manipulate it in Protégé Software with the following steps:
- Choose the model I need Smart Destination, TourismDestinations
- Merge the context.jsonld file and schemaDTLD.json file in a single one enclosed here: sdm_merged_file.json
- Translate from JSON-LD to .ttl in easyrdf.org
The output from easy-rdf is not satisfactory because the contents field is missing, while I was expecting to have a list of classes:
@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<dtmi:com:ngsi-ld:TouristProfile;0>
a <http://njh.me/Interface> ;
dc:description "Description of a tourist profile based on the characteristics of a person, trip, choice of stay and spending while in destination."^^xsd:string .
Next, I tried to tweak it by adding a contents line to the context part of the merged json-ld file:
{
"@context": {
"1": "https://smartdatamodels.org/dataModel.TourismDestinations/1",
[...]
"wheelChairAccessible": "https://smartdatamodels.org/dataModel.TourismDestinations/wheelChairAccessible",
"contents": "https://smartdatamodels.org/example"
},
[...]
But the result is not satisfactory neither, I have a bunch of blank nodes instead of well defined class:
@prefix dc: <http://purl.org/dc/terms/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix ns0: <https://smartdatamodels.org/> .
<dtmi:com:ngsi-ld:TouristProfile;0>
a <http://njh.me/Interface> ;
dc:description "Description of a tourist profile based on the characteristics of a person, trip, choice of stay and spending while in destination."^^xsd:string ;
ns0:example [
a <http://njh.me/Property> ;
ns0:name "alternateName"^^xsd:string
[...]
[
a <http://njh.me/Telemetry> ;
ns0:name "travelPartyComposition"^^xsd:string
] .
Does what I want to do have any sense? Is there a way to translate an SDM to a turtle ontology?
We are currently in progress to create such tool, but unfortunately we cannot commit on a date because it depends on variable resources but we will be glad to collaborate about it.
use our support or live support
BTW the schemaDTDL.json makes no sense to merge it as long as it is a DTDL(a microsoft digital twins solution).
Additionally the tool easyRDF is meant to translate json-ld butschemas are coded in json schema so the result in RDF does not make much sense. This tool is not meant for the conversion of the schemas.
Thank you for the clarifications!