cogai
cogai copied to clipboard
Mapping between Chunks and RDF
The chunks and rules spec has an empty section on the mapping with RDF. This needs to be fleshed out using the information at: chunks and rules - mapping with RDF
The essential idea is to map names to RDF URIs in a manner similar to that used by JSON-LD. This includes support for base URLs, the use of prefixes for brevity, and links to external definitions.
Can we restrict ourselves to mapping names to URIs for now?
I mean, JSON-LD has thorough serialization/deserialization algorithms. How far do we want to go to describe similar mechanisms with chunks?
Yes, I think mapping names to URIs is fine for now. We could map Links to single triples, but in general chunks map to n-ary relations in RDF, i.e. a collection of triples with the same subject node.
I prepared a PR to describe the mapping. I defined @prefix
as a property and not also as a chunk type as in mapping with RDF as I don't see what mandating the prefix chunk type would be useful for.
# Why should p1 be of type "@prefix"?
# Any type could work, what matters it that it gets referenced
# through an @prefix property in the @rdfmap chunk
compact p1 {
ex: http://example.org/ns/
schema: http://schema.org/
}
@rdfmap {
@prefix p1
title ex:title
}