Good catch!

As Adam pointed out, you're using the read() method with a wrong second
argument, i.e. when you use

model.read(String url,
           String base)

the second argument is the base IRI. What you probably want is to use
the read() method with three arguments having the signature

model.read(String url,
           String base,
           String lang)

and the language beeing the third argument:

model.read("http://example.com/ExampleOntology.owl";, null, "TURTLE");

See Javadoc [1] for more information.

[1]
https://jena.apache.org/documentation/javadoc/jena/org/apache/jena/rdf/model/Model.html#read-java.io.InputStream-java.lang.String-

> I cannot find a method read(InputStream stream, String Lang) on Model (from 
> which OntModel inherits its "read" methods). Are you by chance using 
> read(InputStream in, String base), which is a very different semantic?
>
> ---
> A. Soroka
> The University of Virginia Library
>
>> On Mar 31, 2017, at 2:38 PM, Donald Smith <[email protected]> wrote:
>>
>> RDFDataMgr does fine while loading a given RDF file, but what I'm trying to 
>> do is to use OntModel to read an ontology from local disk which would intern 
>> fetch the imported ontologies. For any imported ontology that is fetched via 
>> HTTP that is returned as RDF/XML works fine. For any imported ontology that 
>> is of any other type, such as turtle, it fails.
>>
>> Does OntModel.read(InputStream stream, String Lang) not use RDFDataMgr 
>> itself to load imported ontologies?
>>
>> -----Original Message-----
>> From: Dave Reynolds [mailto:[email protected]]
>> Sent: Thursday, March 30, 2017 2:57 AM
>> To: [email protected]
>> Subject: Re: Ontology Imports
>>
>> On 29/03/17 20:54, Donald Smith wrote:
>>> Given I have an ontology that imports one or more other ontologies, when I 
>>> read that ontology:
>>>
>>> model.read("http://example.com/ExampleOntology.owl";, "TURTLE");
>> That should be "Turtle" or, better, RDFLanguages.strLangTurtle or better 
>> still use RDFDataMgr and let it work out the language.
>>
>> Dave
>> --------------------------------------------------- Confidentiality Notice: 
>> This electronic mail transmission is confidential, may be privileged and 
>> should be read or retained only by the intended recipient. If you have 
>> received this transmission in error, please immediately notify the sender 
>> and delete it from your system.
>
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

Reply via email to