-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Null values in RDF Lists #835
Comments
I looked at #76. Would it make sense that use of null in lists would be handled different? For example,
becomes this in JSON-LD:
In turtle, I could remove [] rdf:first "2"^^xs:long triple, thus asserting nothing about the second position, but a second position in the list would be held for some value in the future, however,
doesn't match as it is expecting ?two to be there. I don't have a way in a compact notation to say:
which would now work with select * where { ?s sdo:about (1 ?two ?3)}, but using this in JSON-LD becomes
Not the compact plain-ish JSON look I was hoping for. My preference would be something like below when using rdf:nil as a place holder
|
Based on discussions in the RDF-star Working Group, you're not likely to see support for a model with non-wellformed lists. Many systems expect lists to be wellformed with each node having both You could use As |
Thanks for replying Gregg, SPARQL allows compact forms like |
@ebremer — Your #835 (comment) cries out for some liberal application of codefences (mostly inline backtick wrappers, |
@TallTed the cries have been heard and answered along with my apologies. |
This is generally required to properly serialize Collections, but indeed, RDF Semantics currently says: "Also, RDF imposes no 'well-formedness' conditions on the use of this vocabulary, so that it is possible to write RDF graphs which assert the existence of highly peculiar objects such as lists with forked or non-list tails, or multiple heads". In general, vocabularies can't impose any conditions on their use, although some profiles may create OWL restrictions. Well-formedness is likely in RDF 1.2 for describing the use of triple terms, and there is a possibility that it will be extended to describe a similar expectation for Collections/Lists. The primary concern is about nodes with multiple values for
Indeed, nothing prohibits this, it's just not used when representing such lists using the I understand most of the uses of null in JSON-LD and agree with them, save the I expect the JSON-LD WG to follow the guidance from the RDF-star WG, and these constraints have not yet been decided. If it is determined that Lists can have well-formedness constraints, and this includes allowing
SPARQL support for Lists is quite limited, and is pretty much limited to the expressivity allowed by simply expanding the list into the first/rest ladder. More complicated things are possible with Property Paths, for which List navigation was an important use case. But, Notation3 does have better support for lists, where a List is a first-class resource, although I don't believe it allows empty elements either. |
I have a need to express a list of ordered items, but with potentially missing values. For example 20, null, 77.
I've read through the documentation, and null values are filtered out when using compaction but the second position needs to be held.
I can model a list in RDF and omit the second rdf:first value, but, JSON-LD likes to filter the nulls away. Is there anyway framing can be used to express the null?
Having { :dcm:00286040": [20, null, 77] } would be a nice concise way of expressing this.
My specific use case is modelling DICOM image metadata:
https://dicom.nema.org/medical/dicom/current/output/chtml/part18/sect_F.2.5.html
I currently use the blank node method, but I'm trying to make the DICOM JSON model more "RDF" by moving the value representations to custom data types. For example:
one triple
[ dcm:00191030 "262144"^^dcm:UL ]
three triples
[ dcm:00191030 [ dcm:Value ( "262144"^^xsd:long ); dcm:vr "UL" ]]
The text was updated successfully, but these errors were encountered: