After trying to debug this more... I have some corrections.
(1) For some reason now, inserting a single triple as a Python string works through Pystardog.
(2) Furthermore, inserting a single triple a raw file now does not work (the code above) through Pystardog.
This is how our code works currently:
def insert_stardog(triple: str, graph_iri: str):
with stardog.Connection(DB_NAME, **SD_CONN_DETAILS) as conn:
conn.begin()
if file_raw == 'file':
conn.add(stardog.content.File(triple), graph_uri=graph_iri)
else:
conn.add(stardog.content.Raw(triple, "text/turtle"), graph_uri=graph_iri)
conn.commit()
I've tried creating the sample triple ('<{iri}> <urn:ontology:lastUpdated> "{last_updated}"^^xsd:dateTime'
) and inserting it into Stardog via Pystardog. The conn.add
with the Python string now works fine... but the file will not add to the named graph no matter what I do. If I try to add it through Studio to the named graph, it works.
I'm really not sure if this a Pystardog thing or if I need to blow away my Stardog DB and build it again from scratch.