- From: Thomas Hoppe <thomas.hoppe@n-fuse.de>
- Date: Wed, 13 Nov 2013 06:53:42 +0100
- To: public-linked-json@w3.org
Hello Markus, thanks for your answer. I didn't knew that it is possible to use @reverse like this in JSON-LD, but good to know :) However, I agree that this is an awkward solution. Good hint to use entailment! This means that in RDF is is not mandatory to define a node type, right? I know that a "range'd property" implicitly creates a virtual subclass of the defining class. Greets, Thomas On 11/12/2013 03:17 PM, Markus Lanthaler wrote: > On Tuesday, November 12, 2013 2:54 PM, Thomas Hoppe wrote: >> Hi, >> is there a way to conveniently type (@type) a collection of nodes? >> This could be useful to prevent repeated @type properties in cases like >> this: >> >> [ >> { >> "@context": ..., >> "@id": "http://manu.sporny.org/about#manu", >> "@type": "foaf:Person", >> "name": "Manu Sporny", >> "knows": "http://greggkellogg.net/foaf#me" >> }, >> { >> "@context": ..., >> "@id": "http://greggkellogg.net/foaf#me", >> "@type": "foaf:Person", >> "name": "Gregg Kellogg", >> "knows": "http://manu.sporny.org/about#manu" >> } >> ] >> >> >> I thought about using @reverse but I think it is not possible to use it >> with JSON-LD keywords. > If you really want, you could use rdf:type and @reverse as follows > > { > "@context": { > ... > "instances": { "@reverse": "rdf:type" } > }, > "@id": "foaf:Person", > "instances": [ > { > "@id": "http://manu.sporny.org/about#manu", > "name": "Manu Sporny", > "knows": "http://greggkellogg.net/foaf#me" > }, > { > "@id": "http://greggkellogg.net/foaf#me", > "name": "Gregg Kellogg", > "knows": "http://manu.sporny.org/about#manu" > } > ] > } > > ... but it looks rather strange IMO. An alternative would be to rely on > entailment (setting the range of a property to the desired type). > > > -- > Markus Lanthaler > @markuslanthaler > >
Received on Wednesday, 13 November 2013 05:54:17 UTC