Closed VladimirAlexiev closed 1 year ago
@rhofvendahl can you please take a peek at this?
@VladimirAlexiev Thanks for pointing this out, and for the explanation!
It looks as though the '@type'
is used almost entirely for ItemList
and identifier
, both of which (as you've pointed out) are used incorrectly. Unless there are any objections I'd like to leave correct implementation of '@type'
for future PRs and for now just remove the offending code.
types
are now removed - closing this issue.
We might want to introduce types on a case by case bases on dedicated tickets.
@nissimsan it's still used in 7 schemas: https://github.com/w3c-ccg/traceability-vocab/search?q=ItemList&type=code Please reopen.
Nice search, @VladimirAlexiev.
The simple solution seems to be just removing '@type': https://schema.org/ItemList
?
I'm afraid that the https://github.com/w3c-ccg/traceability-vocab/pull/686 fix doesn't do much.
Another example from RevocationList2020Status.yml:
revocationListIndex:
title: revocationListIndex
type: string
$linkedData:
term: revocationListIndex
'@id': https://schema.org/itemListElement
revocationListCredential:
title: revocationListCredential
type: string
$linkedData:
term: revocationListCredential
'@id': https://schema.org/LinkRole
example: |-
{
"type" : ["RevocationList2020Status"],
"revocationListIndex" : "0",
"revocationListCredential": "https://example.gov/revocation-lists/urn:uuid:3bc24f87-b47b-43a0-b5bf-b9fde7913746"
}
There are several mistakes here:
revocationListIndex
is an integer position. So it should be mapped to schema:position
and made integer.ItemListElement
points to https://schema.org/ListItem that includes two fields position, item
. Where in the above do you see item
?revocationListCredential
cannot be mapped to the class https://schema.org/LinkRole. Furthermore, when reading the definition (and even name) of that class, I don't see any relevance to the use shown above.This is now controlled by https://github.com/w3c/vc-bitstring-status-list
I suggest we close this issue
The following schemas use https://schema.org/ItemList:
That's a rather specific class that should only be used for ordered lists, and there's no way to specify the class of elements. More precisely, its
itemListElement
must beListItem
, which must have aposition
(integer) anditem
that'sThing
(i.e. unspecific class).Here are 2 specific cases to illustrate the error:
AgricultureActivity.yml:
You cannot state "a list of Persons", and the
Person.yml
schema doesn't have any fields pertaining to ordered lists, nor does the example embedded in AgricultureActivity.yml.The problems are the same.
If you need an ordered list of items, you can do specify this in the JSONLD context:
Then it will be emitted as an
rdf:List
that doesn't have integerposition
fields but uses a linked list to preserve order. It looks nice in turtle, eg:But such list uses blank nodes and looks like the following RDF structure:
Despite JSONLD's syntactic support for rdf:List, you probably will want to avoid it and use your own structure, eg a simplification of schema:ItemList: