Closed datadavev closed 2 years ago
great catch, @datadavev
For reference, here's a gist that demonstrates extracting ordered vs. unordered creator
names using SPARQL.
My impression is that this is a fundamental issue that should be resolved with at least some guidance in the 1.3 release.
schema.org
seems to recognize the challenge of ordered lists through the itemList
structure. Some examples using this approach applied to elements of Dataset
plus a more general recommendation to apply @list
where appropriate may be all that is required for closing this issue.
I agree. I think updating all of our examples to use @list
appropriately would help make it clear, and we should have a brief explanation of the issue in the guide so that people understand the implications of @list
and its utility.
+1 for v1.3
I started a draft of this in a new branch feature_135_jsonld_keywords
. You can read the section here:
Feel free to edit directly on the branch. I will start a PR to track feedback as well.
@mbjones Nice intro. One point that may be of interest here.
Google SDTT validates vocabulary and grammar (V/G). Short-hand: "validates meaning".
JSON-LD Playground only validates syntax. It is possible to express jibberish on JSON-LD Playground.
[i.e: multiple @context
statements initialize terms only; not relationships]
(note: am not criticizing Playground - it does what the JSON validator does while adding the Linked Data features of JSON-LD and is very useful)
In contrast, Gregg Kellogg's Structured Data Linter (SDL), like GSDTT, validates V/G (meaning). The current V/G validation baseline is schema.org.
We are testing integration of other OWL-based ontologies with SDL so that we can validate schema+alt-V/G. Our test cases are PlantOntology and UN FAO Agrontology. When we get that working, it opens the opportunity to validate V/G using complementary ontologies (domain-specific "extensions" to schema).
In effect, we use schema as a baseline (for @Types
that are general-purpose) and add domain axioms.
Still early days here, but may be interesting to your work as it takes shape.
Addendum. Some of the above points are discussed here: https://github.com/schemaorg/schemaorg/issues/2790#issuecomment-840745775
NB: The PR I startted describes the issue but we still have a TODO to update all of our example documents to use the @list
keyword where appropriate.
PR #135 was merged and is a good start. But we still need to updated example documents and provide an overview of using @list
in the "Roles of People" section of Dataset.md
@list
in Dataset.md in "Roles of People"
Unlike plain JSON, lists in JSON-LD are unordered [1, 2]. In cases where ordering of items is to be preserved, it is necessary to use the
@list
keyword to specify the type of container for the items.Ordering may be important in consumer tool chains, for example a list of authors or creators should be ordered as intended when rendering a view of the metadata.
Example 1. Order will be preserved for this list of creators:
Example 2. Ordering for this list of creators will not be preserved:
Ordering may be specified globally within the document by specifying the container type in a context. For example:
Example 3. Ordering of a list of creators is preserved anywhere such a list appears within the context.
1. json-ld/json-ld.org#12 2. https://www.w3.org/TR/json-ld/#lists