We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I ran the code from the README.md and I get this output:
b'[\n {\n "@id": "file:///home/liam/fyp/#hasAllergens",\n "@type": [\n "http://www.w3.org/2000/01/rdf-schema#Property"\n ]\n },\n {\n "@id": "file:///home/liam/fyp/#Ingredient",\n "@type": [\n "http://www.w3.org/2000/01/rdf-schema#Class"\n ]\n },\n {\n "@id": "file:///home/liam/fyp/#Menu",\n "@type": [\n "http://www.w3.org/2000/01/rdf-schema#Class"\n ],\n "http://www.w3.org/2000/01/rdf-schema#subClassOf": [\n {\n "@id": "file:///home/liam/fyp/#Collection"\n }\n ]\n },\n {\n "@id": "file:///home/liam/fyp/",\n "http://purl.org/dc/elements/1.1/title": [\n {\n "@value": "Primer - Getting into the Semantic Web and RDF using N3"\n }\n ]\n },\n {\n "@id": "file:///home/liam/fyp/#Recipe",\n "@type": [\n "http://www.w3.org/2000/01/rdf-schema#Class"\n ]\n },\n {\n "@id": "file:///home/liam/fyp/#StageSequence",\n "@type": [\n "http://www.w3.org/2000/01/rdf-schema#Class"\n ]\n },\n {\n "@id": "file:///home/liam/fyp/#Food",\n "@type": [\n "http://www.w3.org/2000/01/rdf-schema#Class"\n ]\n },\n {\n "@id": "file:///home/liam/fyp/#Collection",\n "@type": [\n "http://www.w3.org/2000/01/rdf-schema#Class"\n ]\n }\n]' b'{\n "@context": {\n "@language": "en",\n "@vocab": "http://purl.org/dc/terms/"\n },\n "@graph": [\n {\n "@id": "file:///home/liam/fyp/#hasAllergens",\n "@type": "http://www.w3.org/2000/01/rdf-schema#Property"\n },\n {\n "@id": "file:///home/liam/fyp/#Ingredient",\n "@type": "http://www.w3.org/2000/01/rdf-schema#Class"\n },\n {\n "@id": "file:///home/liam/fyp/#Menu",\n "@type": "http://www.w3.org/2000/01/rdf-schema#Class",\n "http://www.w3.org/2000/01/rdf-schema#subClassOf": {\n "@id": "file:///home/liam/fyp/#Collection"\n }\n },\n {\n "@id": "file:///home/liam/fyp/",\n "http://purl.org/dc/elements/1.1/title": {\n "@value": "Primer - Getting into the Semantic Web and RDF using N3"\n }\n },\n {\n "@id": "file:///home/liam/fyp/#Recipe",\n "@type": "http://www.w3.org/2000/01/rdf-schema#Class"\n },\n {\n "@id": "file:///home/liam/fyp/#StageSequence",\n "@type": "http://www.w3.org/2000/01/rdf-schema#Class"\n },\n {\n "@id": "file:///home/liam/fyp/#Food",\n "@type": "http://www.w3.org/2000/01/rdf-schema#Class"\n },\n {\n "@id": "file:///home/liam/fyp/#Collection",\n "@type": "http://www.w3.org/2000/01/rdf-schema#Class"\n }\n ]\n}'
The \n newlines are not interpeted and it's difficult to see the structure of the output. This is the case when using python3 but not python2.7.
\n
python3
python2.7
The text was updated successfully, but these errors were encountered:
We probably need to tweak the readme.
The code should say: print(g.serialize(format='json-ld', indent=4).decode())
print(g.serialize(format='json-ld', indent=4).decode())
The default serialization is bytes, not UTF8
Sorry, something went wrong.
Oops - managed to accidentally push the proposed change into the 1.1 branch w/o a pull request. Apologies...
Is this issue still open? As in, do we have to use .decode() after calling .serialize() on a graph?
No branches or pull requests
I ran the code from the README.md and I get this output:
The
\n
newlines are not interpeted and it's difficult to see the structure of the output. This is the case when usingpython3
but notpython2.7
.The text was updated successfully, but these errors were encountered: