Capitains / MyCapytain

Texts API and Textual Resources Utility Library for Python 3
http://mycapytain.readthedocs.org
Mozilla Public License 2.0
8 stars 9 forks source link

Come up with a way to reference the multiple objects for a predicate in the metadata graph #190

Open sonofmun opened 5 years ago

sonofmun commented 5 years ago

When there are multiple values/objects for a single key/predicate in the metadata graph that all share the same xml:lang attribute, there is no way to differentiate them. This could be important for the language, where there might be a primary and secondary (etc.) languages, or with authors or editors, etc. One possible way to handle this would be to have the metadata graph ingest other attributes from the structured-metadata elements than just the language. That would allow the user to decide what attribute they want to use to differentiate the different triples from each other (e.g., @n or @type or @xml:id) and then to query for them when they want to return them from the graph, e.g., "get me language[@n='primary']". I am not sure whether the elements in, e.g., Dublin Core, can take attributes but, if so, this would, I think, be the best and the most generalizable way to deal with this.

sonofmun commented 5 years ago

I don't think this will work the way I would have liked since an RDF Literal can only have the value of the literal (Unicode) and the language or the datatype. Thus, no other attribute could be applied to the object, which is a literal, to distinguish it from another object with the same predicate. Perhaps another triple could be added to the graph that identifies this triple as having a specific value for a specific attribute? I am at the limit of my RDF expertise here.