I am having trouble figuring out how to disambiguate resources that use the same predicate in advance. I am new to RDF, so please excuse my terminology: I will try to explain what I mean with the examples.
I have an Interview resource / model with a (simplified) context like this:
{ "id": { "@id": "http://purl.org/dc/terms/identifier" }, "interviewers": { "@id": "http://purl.org/dc/terms/contributor", "@type": "@id", "@container": "@set" }, "title": { "@id": "http://purl.org/dc/terms/title" }, "interviewees": { "@id": "http://purl.org/dc/terms/contributor", "@type": "@id", "@container": "@set" } }
My Interviewer and Interviewee resources have the following contexts:
{ "id": { "@id": "http://purl.org/dc/terms/identifier" }, "name": { "@id": "info:repository/ive/name" } }
Then I create a resource that looks like this:
{ "id": "06bad25f-83c1-4ee5-b055-0cb87d4c06be", "interviewers": [ { "id": "b0c262ce-7eb3-47f2-b212-a0e71cca0c92", "name": "Somebody", "@context": { ... }, "@id": "urn:uuid:b0c262ce-7eb3-47f2-b212-a0e71cca0c92", "@type": [ "http://id.loc.gov/vocabulary/relators/ivr" ] } ], "title": "Interview with So and So", "interviewees": [ { "id": "bd6bb9ec-f417-4f81-af69-e3d191e3f73b", "name": "A third person", "gender": "male", "@context": { ... }, "@id": "urn:uuid:bd6bb9ec-f417-4f81-af69-e3d191e3f73b", "@type": [ "http://id.loc.gov/vocabulary/relators/ive" ] } ], "@context": { ... }, "@id": "urn:uuid:06bad25f-83c1-4ee5-b055-0cb87d4c06be", "@type": [ "info:repository/interview" ] }
Everything is fine, and I can save this “object” in my repository (I use the RDF.rb libraries). However, problems arise when I try to retrieve an object and "re-serialize" it. For example (sorry Ruby code),
query = repository.query(:subject => RDF::URI(uri)) JSON.parse(query.dump(:jsonld, :context => Interview.context))
These lines retrieve the relevant statements from the repository, and then push them into the JSON-LD resource with the appropriate context. However, both the interlocutors and the interviewers are moved to the interviewees attribute.
Of course, this makes sense, since both interviewers and interviewees are associated with the Interview resource with the predicate dc:contributor (they differ only in their individual types).
I need to make the dump process aware of the associated resource types, but I don’t know how to add this information to the interview context.
I do not know if this is possible according to the current JSON-LS specifications. This problem seems to be relevant, but I really don't know enough about RDF / JSON-LD to know for sure.
I could use different predicates for interviewers and interviewees , but it seems like I shouldn't have done that. Any suggestions?
Note. I also asked this question at answers.semanticweb.com .
ADDITIONAL INFORMATION
I modeled my contributor relationship this way (where Interviewer is a contributor type http://id.loc.gov/vocabulary/relators/ivr ) based on one of the recommended ways to define DC properties. For example, you can express a MESH object on a resource, for example:
<rdf:Description> <dc:subject> <dcterms:MESH> <rdf:value>D08.586.682.075.400</rdf:value> <rdfs:label>Formate Dehydrogenase</rdfs:label> </dcterms:MESH> </dc:subject> </rdf:Description>
Suppose I had:
<rdf:Description> <dc:subject> <dcterms:MESH> <rdf:value>D08.586.682.075.400</rdf:value> <rdfs:label>Formate Dehydrogenase</rdfs:label> </dcterms:MESH> </dc:subject> <dc:subject> <dcterms:LCSH> <rdf:value>Formate Dehydrogenase</rdf:value> </dcterms:LCSH> </dc:subject> </rdf:Description>
I would like to be able to refer to the lcsh_subjects "property, where lcsh_subjects represents those nodes that are connected to the resource using dc:subject AND, which are of type dcterms:LCSH . However, I understand that I probably think of the JSON-LD model wrong.