RDFLib / rdflib-jsonld

JSON-LD parser and serializer plugins for RDFLib
Other
280 stars 71 forks source link

RDFS Type to @type property #102

Closed awanczowski closed 3 years ago

awanczowski commented 3 years ago

I am trying to convert a turtle file that contains rdfs:type. I was wondering if it is possible to have the JSON-LD @type be used instead.

Current Output:

"http://www.w3.org/2000/01/rdf-schema#type": {
        "@id": "sport:Team"
 }

Desired Output: "@type": "sport:Team"

awanczowski commented 3 years ago

Adding the following to the context seems to work as expected. However, I'm not sure if it is good practice to overload the @type property.

"@type": {
            "@id": "http://www.w3.org/2000/01/rdf-schema#type",
            "@type": "@id"
        }
nicholascar commented 3 years ago

Hmmmm... there is no property of RDFS type (rdfs:type), I think you mean RDF type (rdf:type). Try changing the property.

awanczowski commented 3 years ago

Thanks, I forgot to update the ticket. The samples I was given had the wrong namespace.