You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Andy Seaborne (JIRA)" <ji...@apache.org> on 2014/01/10 18:52:55 UTC

[jira] [Comment Edited] (JENA-621) OntDocumentManager always resolves policy file to ont-policy.rdf

    [ https://issues.apache.org/jira/browse/JENA-621?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13867929#comment-13867929 ] 

Andy Seaborne edited comment on JENA-621 at 1/10/14 5:51 PM:
-------------------------------------------------------------

Possible fix:

# Change the jena-core LocatorClassloader to not handle {{file:}} (it's only used by {{OntDocmentManager}} these days and will change sometime).
# Change the default path to {{file:ont-policy.rdf;file:etc/ont-policy.rdf;ont-policy.rdf}}
# Change tests to align.

(NB RIOT {{LocatorClassloader}} does not handle {{file:}} resources - this was possibly the original intention)



was (Author: andy.seaborne):
Possible fix:

# Change the jena-core LocatorClassloader to not handle {{file:}} (it's only used by {{OntDocmentMaanger}} these days and will change sometime).
# Change the default path to {{file:ont-policy.rdf;file:etc/ont-policy.rdf;ont-policy.rdf}}
# Change tests to align.

(NB RIOT {{LocatorClassloader}} does not handle {{file:}} resources - this was possibly the original intention)


> OntDocumentManager always resolves policy file to ont-policy.rdf
> ----------------------------------------------------------------
>
>                 Key: JENA-621
>                 URL: https://issues.apache.org/jira/browse/JENA-621
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: Ontology API
>    Affects Versions: Jena 2.11.0
>            Reporter: Andy Seaborne
>            Priority: Minor
>         Attachments: jena-621-v1.patch
>
>
> Follows on from JENA-525.
> The {{OntDocumentManager}} has a default path for looking for policy files of {{file:ont-policy.rdf;file:etc/ont-policy.rdf}} but as of commit {{r1455078 / 2013-03-11}}, the default policy files go into src/main/resources.
> {{OntDocumentManager}} uses the old/core {{FileManager}} explicitly in {{findMetadata}} with file, URL and classloader locators.
> The core {{LocatorClassloader}} converts URIs to plain file names which then have no {{file:}} so it looks up {{ont-policy.rdf}} on the locator list. This is always found by the class loader - it's in the jar.  {{file:etc/ont-policy.rdf}} will never be tried.
> The consequence is that {{file:ont-policy.rdf}} is always found - it may be a real file or in the jar.
> *Workaround*
> Set the path explicitly with {{OntDocumentManager.setMetadataSearchPath}}



--
This message was sent by Atlassian JIRA
(v6.1.5#6160)