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)
- `rdfpipe` and binding XSD prefix
- HextuplesParser could/should use json.loads with strict=False
- regenerate _DOAP.py HOT 3
- JSON-LD serialization apparently loses XSD type information. HOT 4
- TypeError: Param.postParse2() missing 1 required positional argument: 'tokenList' when executing a SPARQL query with RDFLib 7.0 HOT 1
- Document RDFLib and pyld usage patterns HOT 1
- fails to serialize graphs containing some IRIs to xml HOT 2
- Issues with negative dates HOT 5
- owl:qualifiedCardinality support lacked HOT 1
- The case for removing poetry.lock? HOT 2
- Make dependabot updates to a different target-branch HOT 1
- Force a specific version of `black` in format checking HOT 5
- Add an unbind method on Graph and Namespace Manager to unbind prefixes
- Add xsd:duration sparql functionality HOT 2
- [DISCUSSION] Reasons to keep URIRef, BlankNode, and Literal as subclasses of `str`? HOT 5
- remote sparql queries always use POST HOT 1
- add more sorting options in longturtle serializer HOT 4
- Improve documentation of command-line tools
- Lacking plugin for sparql query results of format application/json HOT 2
- AttributeError: property 'name' of 'Param' object has no setter
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.