Last active
March 13, 2019 19:56
-
-
Save stain/4ae12d225b094246227740d7a93f0bde to your computer and use it in GitHub Desktop.
Linkset JSON as JSON-LD https://github.com/dret/I-D/issues/119
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"@context": [ | |
{ | |
"@vocab": "https://www.iana.org/assignments/link-relations/", | |
"anchor": "@id", | |
"href": "@id", | |
"dct": "http://purl.org/dc/terms/", | |
"link": "https://www.iana.org/assignments/link-relations#", | |
"title": { | |
"@id": "http://purl.org/dc/terms/title" | |
}, | |
"title*": { | |
"@id": "http://purl.org/dc/terms/title" | |
}, | |
"type": { | |
"@id": "dct:format", | |
"@type": "@vocab" | |
} | |
}, | |
{ | |
"language": "@language", | |
"value": "@value", | |
"hreflang": { | |
"@id": "https://www.w3.org/ns/activitystreams#hreflang", | |
"@container": "@set" | |
} | |
} | |
], | |
"linkset": [ | |
{ | |
"anchor": "https://example.org/article/view/7507", | |
"author": [ | |
{ | |
"href": "https://orcid.org/0000-0002-4311-0897", | |
"type": "rdf/xml" | |
} | |
], | |
"item": [ | |
{ | |
"href": "https://example.org/article/7507/item/1", | |
"type": "application/pdf" | |
}, | |
{ | |
"href": "https://example.org/article/7507/item/2", | |
"type": "text/csv" | |
} | |
], | |
"cite-as": [ | |
{ | |
"href": "https://doi.org/10.841/zk2557" | |
} | |
] | |
}, | |
{ | |
"anchor": "https://example.com/links", | |
"alternate": [ | |
{ | |
"href": "https://mirror.example.com/links" | |
} | |
] | |
} | |
] | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<https://example.com/links> <https://www.iana.org/assignments/link-relations/alternate> <https://mirror.example.com/links> . | |
<https://example.org/article/7507/item/1> <http://purl.org/dc/terms/format> <https://www.iana.org/assignments/link-relations/application/pdf> . | |
<https://example.org/article/7507/item/2> <http://purl.org/dc/terms/format> <https://www.iana.org/assignments/link-relations/text/csv> . | |
<https://example.org/article/view/7507> <https://www.iana.org/assignments/link-relations/author> <https://orcid.org/0000-0002-4311-0897> . | |
<https://example.org/article/view/7507> <https://www.iana.org/assignments/link-relations/cite-as> <https://doi.org/10.841/zk2557> . | |
<https://example.org/article/view/7507> <https://www.iana.org/assignments/link-relations/item> <https://example.org/article/7507/item/1> . | |
<https://example.org/article/view/7507> <https://www.iana.org/assignments/link-relations/item> <https://example.org/article/7507/item/2> . | |
<https://orcid.org/0000-0002-4311-0897> <http://purl.org/dc/terms/format> <https://www.iana.org/assignments/link-relations/rdf/xml> . | |
_:b0 <https://www.iana.org/assignments/link-relations/linkset> <https://example.com/links> . | |
_:b0 <https://www.iana.org/assignments/link-relations/linkset> <https://example.org/article/view/7507> . |
Yeah...don't introduce any new @
prefixed terms... That'll run into issues in the future for sure.
In digging a bit more, I think "linkset": {"@container": "@list"}
gets a more correct result. It preserves the "linkset" relationship between multiple blank nodes: one for the linkset and one for each of the contained links (in this example).
Also, excellent points about format
. We used dc:format
(for likely very similar reasons) in the Web Annotation Data Model spec's context file.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
About
type
I think we can't use@vocab
trick here as it should map to some base URI for formats, likehttps://www.iana.org/assignments/media-types/
making https://www.iana.org/assignments/media-types/text/html etc -- but IANA never managed to decide on such a base URI. In addition that would meanformat
would not work with parameters likecharset
.That means we should not use
dct:format
- which is defined with range http://purl.org/dc/terms/MediaTypeOrExtent aka an object property to a URI resource - but rather the more simpledc:format
which allows plain literals. Then simply remove@type
forformat
. That is how we mappedmediatype
in https://researchobject.github.io/specifications/bundle/#json-ld