In order to use Jena's API to navigate RDF graphs, I need to know how this 
particular node is represented. 
If the node were a literal,  its literallexicalform would be sufficient. Since 
the node is represented as an instance of "Resource" the node's label is the 
namespace + the localname. However, 
"http://www.govtrack.us/data/photos/410069."; Is clearly not a NS, and "jpeg" is 
not its local name. 

Using Jena's API how can one determine if the given "Resource" node can 
represented by its literallexicalform, or by its namespace+localname. Thanks.


Thanks, Rodrigo.

-----Original Message-----
From: Andy Seaborne [mailto:[email protected]] 
Sent: Friday, March 22, 2013 4:59 PM
To: [email protected]
Subject: Re: RDF Model Namespaces

On 22/03/13 20:47, Pastrana, Rodrigo (RIS-BCT) wrote:
> I'm new to Jena RDF API and I'm noticing some unexpected behavior regarding 
> statement namespaces...
> I've noticed that URI resources such as  
> "http://www.govtrack.us/data/photos/412483.jpeg"; in the below excerpt 
> of the congressional people 
> graph(http://www.govtrack.us/data/rdf/people.rdf.gz)
> Are reported to have namespace: " http://www.govtrack.us/data/photos/410069."; 
> And local name "jpeg" using the com.hp.hpl.jena.rdf.model.Resource 
> getLocalName(), and getNameSpace().
> Is this correct behavior? It looks to me like the dot is being used as a 
> delimiter between the NS and the local name. Is there a way to change that 
> behavior ? thanks!
>
>
> <foaf:Person 
> rdf:about="http://www.rdfabout.com/rdf/usgov/congress/people/R000589";>
>      <foaf:name>E. Rigell</foaf:name>
>      <usgov:name>E. Rigell</usgov:name>
>      <vcard:N>
>        <rdf:Description>
>          <vcard:Given>E.</vcard:Given>
>          <vcard:Other>Scott</vcard:Other>
>          <vcard:Family>Rigell</vcard:Family>
>          <vcard:Prefix>Rep.</vcard:Prefix>
>        </rdf:Description>
>      </vcard:N>
>      <foaf:gender>male</foaf:gender>
>      <vcard:BDAY>1960-05-28</vcard:BDAY>
>      <foaf:img rdf:resource="http://www.govtrack.us/data/photos/412483.jpeg"/>
>      <usgov:congressBioGuideID>R000589</usgov:congressBioGuideID>
>      <foaf:title>Rep.</foaf:title>
>      <foaf:homepage>http://rigell.house.gov/</foaf:homepage>
>    </foaf:Person>
>
>
> Thanks, Rodrigo.

Jena is finding the maximal XML qname - the namespace mechanism can't be sure 
that it isn't going to be used a property.  Both properties (must) and types 
(can be) qnames in RDF/XML.  RDF does not distinguish 
classes/properties/individuals.

http://www.govtrack.us/data/photos/412483.jpeg

An XML qname local part can't start with a digit or a "." so  "jpeg" is the 
longest local part.

 > Is this correct behavior?

Yes

 > Is there a way to change that behavior ?

No - the RDF/XML serializer is relying on it.

But what are you using the namespace/localname for ?

If it's display, then you are not bound by the XML restrictions and can split 
it yourself.  The resource is the URI - it does not carry it's namespace with 
it.

In Turtle, the prefix names are not restricted, but then there is not a 
requirement to split a URI ever anyway.

        Andy

>
>


-----------------------------------------
The information contained in this e-mail message is intended only
for the personal and confidential use of the recipient(s) named
above. This message may be an attorney-client communication and/or
work product and as such is privileged and confidential. If the
reader of this message is not the intended recipient or an agent
responsible for delivering it to the intended recipient, you are
hereby notified that you have received this document in error and
that any review, dissemination, distribution, or copying of this
message is strictly prohibited. If you have received this
communication in error, please notify us immediately by e-mail, and
delete the original message.

Reply via email to