On 11/03/12 09:05, Petr Křemen wrote:
Hi to all,
Hi Petr,
Which version of SDB and which database are you using? (It looks like
posgresql) What would be helpful is a complete, minimal example,
especially if it works on one of the embedded DBs like H2 or Derby.
Unlike TDB, SDB stores prefixes on a dataset basis, not a per-graph
basis. Changing this would need a change to the on-disk formats so
while it is desirable to do, it's also not insignificant.
I have a single store and two named models opened on top of it, say
model1 and model2. When reading data using
model1.read(...,BASE1)
model2.read(...,BASE2)
the second command fails with
ERROR: duplicate key value violates unique constraint "prefixes_pk"
INSERT INTO Prefixes
VALUES (':', NSOFTHESECOND)
I understand, that a single prefix should not be set to different
mapping within a single SDB store.
My question is - is there a possibility to throw away all prefix
information from the RDF/XMLs and to load the documents with no (or
artifically generated) prefixes, such that the above error disappears
The prefixes are being set because you are parsing directly into
database backed models. If you read into a memory model then add that ,
the prefixes aren't copied over.
Model m = FileManager.get().read(..)
model1.add(m) ;
m = FileManager.get().read(..)
model2.add(m) ;
As a bonus, if there is a problem due to some data error, you only add
data to the database if it was completely readable.
Andy
?
Thanks,
Petr