Comments (7)
As far as i understand it should be "
@type
": "http://xmlns.com/foaf/0.1/Person
" instead, without the[...]
I guess the serialized result you got there is just the JSON-LD in the expanded form. If you don't want it as a list, you can use compaction. Behaviour of @type
here is relevant? https://www.w3.org/TR/json-ld11/#using-set-with-type.
Sorry, haven't looked too much into how this is related to your original issue though.
from rdflib.
It fails at this point: (rt is the dict {"@value": "another thing"}
)
This is the testfile that fails to be loaded again:
rdflib/test/data/suites/n3roundtrip/rdf-test-11.n3
Lines 1 to 14 in 9834665
from rdflib.
Ok i'm pretty sure this is a bug in the serializer and not in the parser. @type
should be a term, a compact iri or a reference and shouldnt contain value objects.(edited after comment from edmondchuc)
I would change the parser to give more leniency and let it fallback to its behaviour of version 1.0
, till the bug in the serializer is repaired. We could remove this behaviour or at least raise a warning in the next major release of rdflib.
from rdflib.
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
[] a foaf:Person.
is serialized to
[
{
"@id": "_:ncd6c76112bd148c0a0c9a8a035854d6cb1",
"@type": [
"http://xmlns.com/foaf/0.1/Person"
]
}
]
As far as i understand it should be "@type": "http://xmlns.com/foaf/0.1/Person"
instead, without the [...]
from rdflib.
Mh your right. I still think value objects arent allowed in that array. so things like {"@type": [{"@value": "thing too"}]}
shouldnt be allowed. (ive changed my comment above to reflect this)
from rdflib.
Yeah, probably the JSON-LD processor in RDFLib is just not as strict. Your provided example fails in https://json-ld.org/playground/ when the value of @type
is a value object.
JSON-LD example: https://tinyurl.com/2atu5gdy
from rdflib.
Ive renamed the issue, because of the bug in the serializer. Now Roundtrip test with default jsonld version 1.1 will succeed.
from rdflib.
Related Issues (20)
- Unable to embed rdflib in a python extension
- Bug when using FROM statements HOT 4
- Bug: Comparison and arithmetic on xsd:duration HOT 1
- SPARQL Subquey parse error HOT 5
- typo in Container method name: type_of_conatiner --> type_of_container
- Turning rdflib jsonld into a "full processor" (a.o. for schema.org compliance) HOT 3
- Incorrect working when deleting triplets in a BerkeleyDB store HOT 1
- Graph.parse: Guess format when remote source content type is "text/plain"
- Optional skolemize blank nodes on parse HOT 3
- FAILED test/test_misc/test_parse_file_guess_format.py::TestFileParserGuessFormat::test_warning HOT 2
- RFE: move away from deprecated `html5lib` HOT 1
- BUG : jsonld parser does not randomise bnodes when using local _prefixed identifiers `"@id": "_:mybnode01"` HOT 1
- Adding a value as a list to the graph HOT 4
- Bug in `longturtle` serialization HOT 2
- Rdflib 7.0.0: Inadequate Support for Importing Multiple Prefixes with the Same IRI and Base IRI HOT 2
- Unexpected recursive context inclusion exception HOT 2
- Bug: Unexpected namespace creation during turtle file serialization HOT 4
- Using `orjson` instead of default `json` library HOT 1
- Error when parsing turtle file
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rdflib.