-
Notifications
You must be signed in to change notification settings - Fork 576
Closed
Description
I have a trig file with just one graph like this:
@prefix adm: <http://purl.bdrc.io/ontology/admin/> .
@prefix bda: <http://purl.bdrc.io/admindata/> .
@prefix bdg: <http://purl.bdrc.io/graph/> .
bdg:W1NLM5228 {
bda:W1NLM5228 a adm:AdminData ;
adm:status bda:StatusReleased .
}
In my use case I need to be able to read it, modify it and then write it with the same prefix definitions, but when I do something very simple like
import rdflib
from rdflib import Literal, Graph, Dataset, URIRef
import os
ds = Dataset()
ds.parse("bug.trig", format="trig", publicID=URIRef("http://purl.bdrc.io/graph/W1NLM5228"))
ds.remove_graph(URIRef("urn:x-rdflib:default")) # doesn't work
ds.serialize(filepath+"-bug", format="trig")
the output I get is
@prefix adm: <http://purl.bdrc.io/ontology/admin/> .
@prefix bda: <http://purl.bdrc.io/admindata/> .
@prefix bdg: <http://purl.bdrc.io/graph/> .
@prefix ns1: <urn:x-rdflib:> .
bdg:W1NLM5228 {
bda:W1NLM5228 a adm:AdminData ;
adm:status bda:StatusReleased .
}
and I seem unable to remove the ns1: <urn:x-rdflib:>
prefix definition. Is there any way to do so? Thanks!
Metadata
Metadata
Assignees
Labels
No labels