neo4j-labs / rdflib-neo4j

RDFLib Store backed by neo4j + n10s
Apache License 2.0
55 stars 6 forks source link

Importing LD-JSON encoded RDF Data leads to AssertionError. #19

Closed christophbrosch closed 5 months ago

christophbrosch commented 7 months ago

Using the package, as shown in the README, and trying to parse LD-JSON data as such:

config = Neo4jStoreConfig(auth_data=auth_data,
                          custom_prefixes={"sch": "http://schema.org/"},
                          handle_vocab_uri_strategy=HANDLE_VOCAB_URI_STRATEGY.IGNORE,
                          batching=True)

neo4j_aura = Graph(store=Neo4jStore(config=config))
neo4j_aura.parse(LD-JSON-FILE, format="json-ld")
neo4j_aura.commit()
neo4j_aura.close()

Leads to an AssertionError from RDFLIB.

AssertionError: ConjunctiveGraph must be backed by a context aware store.

Converting the same data to TTL, using the default RDFLIB Graph, and then importing the TTL-File into Neo4j, does work as a workaround. But is not desirable.

graph = Graph() # RDFLIB Graph
graph.parse(LD-JSON-FILE, format="json-ld")
graph.bind("sch", "http://schema.org/")
graph.serialize("test.ttl", format="ttl")
neo4j_aura.parse("test.ttl", format="ttl")

Example LD-JSON File: product.json

Kind regards Christoph

alfredorubin96 commented 5 months ago

Hi Christoph, we just pushed the JSON-LD format support to the develop branch. We will release it soon.

Best Regards, Alfredo Rubin

christophbrosch commented 5 months ago

Installed the current develop branch via pip and it seems to work now as expected. Thanks for the efforts!