[
https://issues.apache.org/jira/browse/JENA-676?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13970632#comment-13970632
]
Andre Wallat commented on JENA-676:
-----------------------------------
After some research I was not able to find any convention saying that a
namespace should end in a # or /. Even in the RFC
(http://tools.ietf.org/html/rfc3987#page-6) which defines the syntax of IRIs I
could not find this rule. Several examples and documentations also show
namespaces with no trailing # or /.
In my opinion, Jena should also return a namespace when there's no trailing #
or /. So, for example, that the following should return the defined IRI in the
variable nsIRI (model is an instance of "com.hp.hpl.jena.rdf.model.Model"):
Namespace definition in XML:
{{xmlns:gn="http://www.geonames.org/ontology"}}
in Java:
{{String nsIRI = model.getNsPrefixURI("gn");}}
In order to read any property within such a namespace I have to determine the
namespace first. This function is essential.
> Namespace is not recognized
> ---------------------------
>
> Key: JENA-676
> URL: https://issues.apache.org/jira/browse/JENA-676
> Project: Apache Jena
> Issue Type: Question
> Affects Versions: Jena 2.11.1
> Reporter: Andre Wallat
> Priority: Minor
>
> I found an issue when accessing a property of an RDF-document. I wanted to
> read a property called "gn:successor". So the normal way is to get the
> namespace of "gn" (which is "http://www.geonames.org/ontology") and create a
> property object, which I use then to receive the property as a statement.
> {{String nsURI = res.getModel().getNsPrefixURI("gn");}}
> {{Property prop = res.getModel().createProperty(nsURI + "successor");}}
> {{Statement stmt = res.getProperty(prop);}}
> For some reason this is not working for a specific document. I checked all
> the available Namespaces and only the "gn" is missing and I don't know why.
> Instead I can access the Propery with
> "http://www.geonames.org/ontologysuccessor" where the # is missing.
> Could anyone please verify this?
> The document to check is:
> http://iqvoc-gazetteer.innoq.com/de/concepts/GEMEINDE1510100000.rdf
--
This message was sent by Atlassian JIRA
(v6.2#6252)