cogai icon indicating copy to clipboard operation
cogai copied to clipboard

Mapping between Chunks and RDF

Open draggett opened this issue 3 years ago • 3 comments

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.

draggett avatar Mar 22 '21 12:03 draggett

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?

tidoust avatar Mar 29 '21 16:03 tidoust

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.

draggett avatar Mar 29 '21 16:03 draggett

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
}

tidoust avatar Jul 09 '21 10:07 tidoust