Closed rhiaro closed 7 years ago
When I parse expanded JSON-LD with an @id with an empty string value or a string that doesn't start with http the results are weird. It should be treated as a relative URI. For example:
@id
$quads = \ML\JsonLD\JsonLD::toRdf($data);
where $data is:
$data
[ { "http://www.w3.org/ns/activitystreams#object": [ { "@id": "https://rhiaro.co.uk/2016/09/57dfffa1b5bfb" } ], "http://www.w3.org/ns/activitystreams#target": [ { "@id": "https://linkedresearch.org/ldn/" } ], "@id": "#this", "@type": [ "http://www.w3.org/ns/activitystreams#Announce" ] } ]
results in the subject of all triples being literally the string: "[ { "http://www.w3.org/ns/activitystreams#this
"[ { "http://www.w3.org/ns/activitystreams#this
and
[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams#Announce" ], "https://www.w3.org/ns/activitystreams#object": { "@id": "https://linkedresearch.org/annotation/rhiaro/thesis/fe2273f6-ed65-4100-87b7-ce89a2b317b4" }, "https://www.w3.org/ns/activitystreams#target": { "@id": "https://rhiaro.github.io/thesis/#abstract" }, "https://www.w3.org/ns/activitystreams#updated": { "@type": "http://www.w3.org/2001/XMLSchema#dateTime", "@value": "2017-04-05T08:04:31.637Z" }, "http://schema.org/license": { "@id": "https://creativecommons.org/licenses/by/4.0/" }, "@context": [ "https://www.w3.org/ns/activitystreams", { "oa": "http://www.w3.org/ns/anno.jsonld" } ] } ]
results in: [ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams for the subject. ie.
[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams
<[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://www.w3.org/ns/activitystreams#Announce> . <[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams> <http://schema.org/license> <https://creativecommons.org/licenses/by/4.0/> . <[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams> <https://www.w3.org/ns/activitystreams#object> <https://linkedresearch.org/annotation/rhiaro/thesis/fe2273f6-ed65-4100-87b7-ce89a2b317b4> . <[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams> <https://www.w3.org/ns/activitystreams#target> <https://rhiaro.github.io/thesis/#abstract> . <[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams> <https://www.w3.org/ns/activitystreams#updated> "2017-04-05T08:04:31.637Z"^^<http://www.w3.org/2001/XMLSchema#dateTime> .
It's like it's taking everything from the begining of the JSON-LD blob and continuing until it reaches the end of a URI?
Update: I tried passing a base and got the same result.
NEVER MIND I messed around with the base parameter some more and it worked. No idea what I did wrong the first time.
When I parse expanded JSON-LD with an
@id
with an empty string value or a string that doesn't start with http the results are weird. It should be treated as a relative URI. For example:where
$data
is:results in the subject of all triples being literally the string:
"[ { "http://www.w3.org/ns/activitystreams#this
and
results in:
[ { "@id": "", "@type": [ "https://www.w3.org/ns/activitystreams
for the subject. ie.It's like it's taking everything from the begining of the JSON-LD blob and continuing until it reaches the end of a URI?
Update: I tried passing a base and got the same result.