Closed djarecka closed 2 years ago
to_newformat
only accepts a path, see: https://github.com/dandi/dandi-archive/issues/1096
that's not true, I was using this with json, e.g.:
test_json_11 = {
"@context": {
"@version": 1.1,
"skos": "http://www.w3.org/2004/02/skos/core#",
"labels": "@nest",
"main_label": {"@id": "skos:prefLabel"},
"other_label": {"@id": "skos:altLabel"},
"homepage": {"@id": "http://schema.org/description", "@type": "@id"}
},
"@id": "http://example.org/myresource",
"homepage": "http://example.org",
"labels": {
"main_label": "This is the main label for my resource",
"other_label": "This is the other label"
}
}
to_newformat(test_json_11, format="turtle")
i pasted the wrong link, here is the correct one: https://github.com/ReproNim/reproschema-py/blob/master/reproschema/jsonldutils.py#L78
the code is set up only to accept a path or url. it may work on some json strings only when the @id
is an absolute uri, as is the case of your latest example. it will not work with missing @id
or implicit ones or relative ones.
oh, ok. I used json for dandi, so assumed it should work for json. Thanks
I have a jasonld, that doesn't give me any error when using json-ld playground
but when I'm trying to convert to turtle using
to_newformat(test_json, format="turtle")
it complains about@id
and I get error:Is this a bug or there is a reason to not support it?