Hi, I think I've found a problem with saveAsNTriplesFile : URIs with a very common namespace (like http:// www. w3.org/ 1999/ 02/ 22-rdf-syntax-ns#) are abbreviated, so the written N-Triples files may hold triples such as:
<http://www.my.namespace.org/subject> rdf:type <http://www.my.namespace.org/object> .
This is because in JenaTripleToNTripleString.scala we have :
class JenaTripleToNTripleString
extends (Triple => String)
with java.io.Serializable {
override def apply(t: Triple): String = s"${FmtUtils.stringForTriple(t)} ."
}
so stringForTriple(t) will use commonly known namespaces.
I suggest the following fix, which simply consists in using an empty PrefixMappingImpl object :
private class JenaTripleToNTripleString
extends (Triple => String)
with java.io.Serializable {
override def apply(t: Triple): String = s"${FmtUtils.stringForTriple(t,new PrefixMappingImpl())} ."
}
Cheers
Hi, I think I've found a problem with saveAsNTriplesFile : URIs with a very common namespace (like http:// www. w3.org/ 1999/ 02/ 22-rdf-syntax-ns#) are abbreviated, so the written N-Triples files may hold triples such as:
<http://www.my.namespace.org/subject> rdf:type <http://www.my.namespace.org/object> .This is because in JenaTripleToNTripleString.scala we have :
so stringForTriple(t) will use commonly known namespaces.
I suggest the following fix, which simply consists in using an empty PrefixMappingImpl object :
Cheers