RDFLib / rdflib-jsonld

JSON-LD parser and serializer plugins for RDFLib
Other
282 stars 71 forks source link

@graph not parsed correctly #66

Open samuraraujo opened 5 years ago

samuraraujo commented 5 years ago

RDFLib output a empty graph after parsing this file. is this a known bug ? { "@context": { "@vocab": "http://xmlns.com/foaf/0.1/", "knows": {"@type": "@id"} }, "@graph": [{ "name": "Manu Sporny", "@type": "Person", "knows": "https://greggkellogg.net/foaf#me" }, { "@id": "https://greggkellogg.net/foaf#me", "@type": "Person", "name": "Gregg Kellogg" }] }

ibtisaam-butt-nbs commented 5 years ago

I am facing the same issue. I am able to do it, using the inline schema without the key word "@context". However, rdflib returns an empty list or just the schema reference when used with graph. For example: [ { "@id": "_:b131978533", "@type": [ "http://schema.org/Organization" ], "https://schema.org/subject_duns": [ { "@value": "131978533" } ], "https://schema.org/country_code": [ { "@value": 1073 } ], "https://schema.org/business_name": [ { "@value": "KMART HOLDING CORPORATION" } ], "https://schema.org/owner_duns": [ { "@value": "191222244" } ], "https://schema.org/owner_association_type": [ { "@value": "Parent" } ], "https://schema.org/Subsidiary": [ { "@id": "_:b191222244" } ] } ]

returns the correct rdfxml.

But this: { "@context": { "SUBJECT_DUNS": { "@id": "https://schema.org/subject_duns", "type": "duns" }, "COUNTRY_CODE": { "@id": "https://schema.org/country_code", "type": "integer" } }, "@graph":[ { "@id": "_:b131978533", "@type": [ "http://schema.org/Organization" ], "SUBJECT_DUNS": [ { "@value": "131978533" } ], "COUNTRY_CODE": [ { "@value": 1073 } ] } ] }

returns an empty list.