No. If you run the test case you see that RDF/XML writes out xmlns defns of prefixes and uses the prefixes in the serialization. Perhaps you are thinking of n-triples.
Thanks, Chris > On Feb 22, 2019, at 16:52, Martynas Jusevičius <[email protected]> wrote: > > Isn't it so that RDF/XML writer always writes absolute URIs, so > xml:base is unnecessary because it would have no effect anyway? > > On Fri, Feb 22, 2019 at 11:20 PM Chris Tomlinson > <[email protected]> wrote: >> >> Hello, >> >> We are trying to serve various ontology files in a variety of >> serializations, principally RDF/XML and Turtle. >> >> The specs indicate that if the baseURI for an ontology is the URL by which >> the ontology is retrieved then it is not required that the producer include >> an explicit xml:base or @base or similar in the serialization. >> >> However, we are wanting to ensure that there is an explicit baseURI present >> in the resulting serialization. >> >> This is because not all tools respect the injunction to use the URL that was >> used to retrieve the ontology as the baseURI if there is not an explicit >> xml:base or @base and so on in the serialization. >> >> The question is that Model.write(OutputStream, Language, baseURI) includes >> an @base when the language is “TURTLE“ in the serialization but when the >> language is “RDF/XML” we do not see an xml:base in the result. (same happens >> when OntModel is used and when RDFWriter is used.) >> >> The docs indicate that the baseURI param is to be used to specify what URI >> should be used to serialize relative URIs and says nothing about including >> xml:base or @base; yet, we see the @base for Turtle and no xml:base for >> RDF/XML. >> >> This is an issue when a tool requests RDF/XML before Turtle in accept >> headers and requires that there be an xml:base in the RDF/XML serialization. >> Noting that RDF/XML is the only required serialization. >> >> What procedure should be used to “force” an @base or xml:base uniformly? >> >> Here is a small test case that shows the issue: >> >> >> https://github.com/buda-base/lds-pdi/blob/master/src/test/java/io/bdrc/ldspdi/test/ModelWriteTest.java >> >> <https://github.com/buda-base/lds-pdi/blob/master/src/test/java/io/bdrc/ldspdi/test/ModelWriteTest.java> >> >> >> Thank you, >> Chris >> >>
