PixarAnimationStudios / OpenUSD-proposals

Share and collaborate on proposals for the advancement of USD
92 stars 25 forks source link

Semantic Schema API proposal #19

Closed dennis-lynch-nv closed 2 months ago

dennis-lynch-nv commented 8 months ago

API to store semantic labels on prims

A simple multiple-apply schema proposal to store semantic data labels on USD prims, for use in AI/ML or Computer Vision applications.

Supporting Materials

None

Contributing

kevthecoder commented 5 months ago

Thanks for putting together the proposal.

I'm interested in RDF / Semantic Web for interlinked game worlds and I was trying to see how it could work with this schema. I thought I'd drop a few thoughts here.

A bit of background to RDF for anyone reading who is not familiar - it basically tries to reduce knowledge down into simple atomic statements into the form "Subject–Predicate–Object". For example "The glass (Subject) is on (Predicate) the table (Object)". These atomic statements can then be chained together into a knowledge graph (e.g. when the Object of one statement becomes the Subject of another).

My tentative conclusion is that RDF could be made to fit this proposal's schema by following some conventions. By assuming that the current Prim is the Subject, then the Predicate name could be included in the Multiple-Apply namespace, and finally the Objects ending up in the labels list. As an example, here's some markup which could be applied to a Prim which represents an instance of a car (with a link to more detailed information):

token[] semantics:rdf_type:labels = ["https://schema.org/Car", "https://schema.org/Vehicle"]
token[] semantics:rdfs_label:labels = ["Bob's car"]
token[] semantics:rdfs_seeAlso:labels = ["https://example.com/my-car-123"]

It looks slightly strange from an RDF point of view. The character : is often used in RDF namespaces (e.g. rdf:type, rdfs:seeAlso), but I've replaced it with an underscore in the example above to prevent collisions with the Multiple-Apply namespace (which also uses :). I accept conventions around token names are outside the scope of the current proposal though.

One other thought is that label is a common property in RDF, so it's a little odd seeing labels tacked onto the end of every namespace name, but I guess it's going to hard to pick something that's generic enough (members, items, ...?). I recognise the term 'labels' is often used in ML, so not a big deal.

It would be nice to have support for adding full RDF triples to OpenUsd, but I recognise that would probably be handled better in a dedicated schema in the future if we need it.

dennis-lynch-nv commented 5 months ago

Hi @kevthecoder ,

Web semantics (specifically OWL and RDF) was something I looked-at when crafting this.

Overall, the conclusion was that OWL/RDF was very powerful, but also more complex than the current proposal. Since there are many datasets that are simpler key:value pairs

But, as you note), RDF can still be mapped-onto this schema if someone wishes and I think that your example is fairly spot-on with how to accomplish this.

kevthecoder commented 5 months ago

Thanks for reviewing @dennis-lynch-nv!

dsyu-pixar commented 2 months ago

@dennis-lynch-nv apologies, would it be possible to git-sign the commits?

dennis-lynch-nv commented 2 months ago

@dsyu-pixar - Commits have been signed