w3c / cogai

for work by the Cognitive AI community group
Other
53 stars 24 forks source link

Mapping between Chunks and RDF #34

Open draggett opened 3 years ago

draggett commented 3 years ago

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.

tidoust commented 3 years ago

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?

draggett commented 3 years ago

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.

tidoust commented 3 years ago

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
}