rdf4j: Adding a Model to a repository doesn't transfer its namespaces
When adding a Model to a Repository with conn.add(model), its namespaces get lost.
Writing the repo to a file like
RDFWriter writer = Rio.createWriter(RDFFormat.TURTLE, outputStream);
conn.export(writer);
produces a very unreadable Turtle file with no prefixes.
Only after manually re-adding them like this
for (Namespace ns : ontologyNamespaces) {
conn.setNamespace(ns.getPrefix(), ns.getName());
}
does the output actually contain prefixes. It definitely the act of adding the model and not the RDFwriter’s fault.
If this is a bug, I’d be happy to contribute. If this is expected behavior (which is counter-intuitive in my opinion), is there a nicer way to include the namespaces when importing?
VERSION: 3.4.4
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (16 by maintainers)
Commits related to this issue
- GH-2749: Initial Namespace import implementation Signed-off-by: Dzerom Dzenkins <dzeri96@proton.me> — committed to Dzeri96/rdf4j by Dzeri96 2 years ago
- Merge branch 'eclipse:main' into GH-2749-add-statements-with-namespaces — committed to Dzeri96/rdf4j by Dzeri96 2 years ago
- GH-2749: Initial Namespace import implementation Signed-off-by: Dzeri96 <dzeri96@proton.me> — committed to Dzeri96/rdf4j by Dzeri96 2 years ago
- GH-2749: Second iteration of Namespace imports Signed-off-by: Dzeri96 <dzeri96@proton.me> — committed to Dzeri96/rdf4j by Dzeri96 2 years ago
- GH-2749: Second iteration of Namespace imports Signed-off-by: Dzeri96 <dzeri96@proton.me> — committed to Dzeri96/rdf4j by Dzeri96 2 years ago
- GH-2749 Include Namespaces in Statement imports from NamespaceAware collections (#4262) — committed to eclipse-rdf4j/rdf4j by abrokenjester 2 years ago
Not a problem @Dzeri96. If you need a second pair of eyes to figure it out don’t hesitate to shout!
@jeenbroekstra I’m sorry I haven’t started sooner, but as usual some things came up. I’m planing to start working on this in two days, though I can’t estimate how long the actual work will take. I will keep you posted as soon as I have something worthwhile.
If others agree, I’d like to work on this when I have some free time. ETA for a PR is mid-february if the issue is not too complicated