You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Andy Seaborne <an...@apache.org> on 2013/08/28 14:32:10 UTC

Problems reading local file (OntDocumentManager/FileManager)

On 28/08/13 03:32, Deyan Chen wrote:
> Hi Andy,
>
> This is the link to the email:
>
> http://jena.markmail.org/message/w3zuxsyny5bofrjw?q=2%2E10%2E1+OntDocumentManager
>
>
> The attachment is a Netbeans Project for test the problem. You can test
> it with jena 2.10.0(it's ok) and jena 2.10.1(it's not ok) respectively.
>
> Because this problem has nothing to do with the TDB, so I test it with
> an in-memory ontology model.
>
> Thank you very much.

After emerging from a twisty maze of configuration files, all alike, 
I've managed to recreate the situation.

Recorded as:
https://issues.apache.org/jira/browse/JENA-525

It's unrelated to TDB.  It seems to be related to the new FileManager 
setup in 2.10.1 not being properly cloned in 
OntDocumentManager.setFileManager.

The getCachingModels => isCachingModels change is just a rename.

	Any

>
> Deyan
>
> 于 2013年08月27日 17:14, Andy Seaborne 写道:
>> On 27/08/13 06:04, Deyan Chen wrote:
>>> Hi Andy,
>>>
>>> I found the same problem as Emilio. It seems that document manager
>>> policy file(etc/ont-policy.rdf) is invalid.
>>
>> Do you have a link to the email?  We get a lot of email and I've lost
>> track of this.
>>
>>> My test code is as follows:
>>>
>>> Dataset ds = TDBFactory.createDataset("tdb/mydb");
>>> Model base = ds.getDefaultModel();
>>> OntModel model = ModelFactory.createOntologyModel( spec, base );
>>> model.read(sourceURL);
>>>
>>> I have also tested this code with all previous version of apache-jena
>>> including 2.10.0 and it works. But It fails in the latest one 2.10.1.
>>
>> Does it work for in-memory models or is it TDB specific?
>>
>> A complete, minimal, example would be helpful.
>>
>>     Andy
>>
>>>
>>> And then I compare jena 2.10.0 with 2.10.1 to find the differences of
>>> the source file OntDocumentManager.java:
>>>
>>> 2.10.0:
>>>
>>> ...
>>>
>>> if (getFileManager().getCachingModels() &&
>>> ...
>>>
>>> return getFileManager().getCachingModels();
>>> ...
>>>
>>> 2.10.1:
>>> ...
>>>
>>> if (getFileManager().isCachingModels() &&
>>> ...
>>>
>>> return getFileManager().isCachingModels();
>>> ...
>>>
>>> I think that the difference isn't the root cause, but I am not sure.
>>>
>>> Would you please tell me why?
>>>
>>> Thank you very much.
>>>
>>> Deyan
>>> ---------------------------------------------------------------------------------------------------
>>>
>>> Confidentiality Notice: The information contained in this e-mail and
>>> any accompanying attachment(s)
>>> is intended only for the use of the intended recipient and may be
>>> confidential and/or privileged of
>>> Neusoft Corporation, its subsidiaries and/or its affiliates. If any
>>> reader of this communication is
>>> not the intended recipient, unauthorized use, forwarding, printing,
>>> storing, disclosure or copying
>>> is strictly prohibited, and may be unlawful.If you have received this
>>> communication in error,please
>>> immediately notify the sender by return e-mail, and delete the
>>> original message and all copies from
>>> your system. Thank you.
>>> ---------------------------------------------------------------------------------------------------
>>>
>>>
>>
>>
>
> ---------------------------------------------------------------------------------------------------
>
> Confidentiality Notice: The information contained in this e-mail and any
> accompanying attachment(s) is intended only for the use of the intended
> recipient and may be confidential and/or privileged of Neusoft
> Corporation, its subsidiaries and/or its affiliates. If any reader of
> this communication is not the intended recipient, unauthorized use,
> forwarding, printing,  storing, disclosure or copying is strictly
> prohibited, and may be unlawful.If you have received this communication
> in error,please immediately notify the sender by return e-mail, and
> delete the original message and all copies from your system. Thank you.
> ---------------------------------------------------------------------------------------------------
>


Re: About meta data search path problem

Posted by Deyan Chen <ch...@neusoft.com>.
I see. Thank you very much.

于 2014年01月10日 23:54, Andy Seaborne 写道:
> On 10/01/14 11:58, Andy Seaborne wrote:
>> Could you reopen JENA-525 and record this please?
>
> After investigation, I raised JENA-621 and wrote up a possible fix.
>
> Another workaround is if you put your ont-policy.rdf in the current 
> working directory.
>
> Setting the metadata search path explicitly is probably the best 
> solution.
>
>     Andy
>
>

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------

Re: About meta data search path problem

Posted by Andy Seaborne <an...@apache.org>.
On 10/01/14 11:58, Andy Seaborne wrote:
> Could you reopen JENA-525 and record this please?

After investigation, I raised JENA-621 and wrote up a possible fix.

Another workaround is if you put your ont-policy.rdf in the current 
working directory.

Setting the metadata search path explicitly is probably the best solution.

	Andy


Re: About meta data search path problem

Posted by Andy Seaborne <an...@apache.org>.
On 10/01/14 08:34, Deyan Chen wrote:
> hey,
>
> About meta data (ontology document manager policy file) search path, we
> can get the default search path by the following code,
>
> OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
> System.out.println(model.getDocumentManager().getMetadataSearchPath());
>
> The output is as the follows,
>
> file:ont-policy.rdf;file:etc/ont-policy.rdf
>
> In jena 2.10.0, the test result is ok. But I find  jena 2.11.0 only
> support "file:ont-policy.rdf". That is to say, when I place the
> ont-policy.rdf into {project-directory}/etc, it can't find it. When we
> perform the following code to specify it,
>
> model.getDocumentManager().setMetadataSearchPath("file:etc/ont-policy.rdf",
> true);
>
> then it's ok.

That's useful to know.  It suggests it was the change between 2.10.0 and 
2.10.1 that moved src/main/resources/ont-policy.rdf from 
etc/ont-policy.rdf.  The old LocatorClassLoader happens to skip "file:" 
so it loads the first found ... which is the default .. then concludes.

$ svn log src/main/resources/ont-policy.rdf
------------------------------------------------------------------------
r1455078 |    | 2013-03-11 10:01:29 +0000 (Mon, 11 Mar 2013) | 1 line

Moved OntDocumentManager default policy to src/main/resources from 
etc/ont-policy.rdf.

Could you reopen JENA-525 and record this please?

(JENA-525 fixed a different issue but the presenting symptoms are very 
similar)

	Andy


https://issues.apache.org/jira/browse/JENA-525


>
> deyan chen
> ---------------------------------------------------------------------------------------------------
>
> Confidentiality Notice: The information contained in this e-mail and any
> accompanying attachment(s) is intended only for the use of the intended
> recipient and may be confidential and/or privileged of Neusoft
> Corporation, its subsidiaries and/or its affiliates. If any reader of
> this communication is not the intended recipient, unauthorized use,
> forwarding, printing,  storing, disclosure or copying is strictly
> prohibited, and may be unlawful.If you have received this communication
> in error,please immediately notify the sender by return e-mail, and
> delete the original message and all copies from your system. Thank you.
> ---------------------------------------------------------------------------------------------------
>


About meta data search path problem

Posted by Deyan Chen <ch...@neusoft.com>.
hey,

About meta data (ontology document manager policy file) search path, we 
can get the default search path by the following code,

OntModel model = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
System.out.println(model.getDocumentManager().getMetadataSearchPath());

The output is as the follows,

file:ont-policy.rdf;file:etc/ont-policy.rdf

In jena 2.10.0, the test result is ok. But I find  jena 2.11.0 only 
support "file:ont-policy.rdf". That is to say, when I place the 
ont-policy.rdf into {project-directory}/etc, it can't find it. When we 
perform the following code to specify it,

model.getDocumentManager().setMetadataSearchPath("file:etc/ont-policy.rdf", 
true);

then it's ok.

deyan chen
---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------

Re: Problems reading local file (OntDocumentManager/FileManager)

Posted by Deyan Chen <ch...@neusoft.com>.
Andy,

I find that the following problem is still not resolved in jena 2.11.0.

deyan chen

于 2013年08月29日 00:44, Andy Seaborne 写道:
>> Recorded as:
>> https://issues.apache.org/jira/browse/JENA-525
>
> Should be fixed now, as in your test case works for me.  Please try it 
> and let us know if it work for you. The snapshot is rebuilding at the 
> moment (so give it about 10 mins from the time of this message).
>
>     Andy
>
>
>

---------------------------------------------------------------------------------------------------
Confidentiality Notice: The information contained in this e-mail and any accompanying attachment(s) 
is intended only for the use of the intended recipient and may be confidential and/or privileged of 
Neusoft Corporation, its subsidiaries and/or its affiliates. If any reader of this communication is 
not the intended recipient, unauthorized use, forwarding, printing,  storing, disclosure or copying 
is strictly prohibited, and may be unlawful.If you have received this communication in error,please 
immediately notify the sender by return e-mail, and delete the original message and all copies from 
your system. Thank you. 
---------------------------------------------------------------------------------------------------

Re: Problems reading local file (OntDocumentManager/FileManager)

Posted by Andy Seaborne <an...@apache.org>.
> Recorded as:
> https://issues.apache.org/jira/browse/JENA-525

Should be fixed now, as in your test case works for me.  Please try it 
and let us know if it work for you. The snapshot is rebuilding at the 
moment (so give it about 10 mins from the time of this message).

	Andy