You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by mehmet mehmet <me...@gmail.com> on 2016/04/25 17:33:13 UTC

resource rdfs label

This is my Jena query

"SELECT * " + "WHERE {"  ?x tre:has_boss tre:Good." + "}" ;

IT gives me correct answer but in URI form

www.semanticweb/myontology/IT_Manager

*I want just IT_Manager. I tried rdfs:label but does not work.*

(IT_Manager is a resource object in my ontology)

Re: resource rdfs label

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
You can only get the rdfs:label if it's contained in the dataset. 
Otherwise you would have to extract the URI fragment resp. what's behind 
the '/' .

> You should not be looking at the URI as a label.
>
> How did you try rdfs:label? Something like this should work:
>
> SELECT *
> WHERE
> {
>    ?x tre:has_boss tre:Good ;
>      rdfs:label ?label .
> }
>
> Needs tre: and rdfs: PREFIXes of course.
>
> On Mon, Apr 25, 2016 at 5:33 PM, mehmet mehmet <me...@gmail.com> wrote:
>> This is my Jena query
>>
>> "SELECT * " + "WHERE {"  ?x tre:has_boss tre:Good." + "}" ;
>>
>> IT gives me correct answer but in URI form
>>
>> www.semanticweb/myontology/IT_Manager
>>
>> *I want just IT_Manager. I tried rdfs:label but does not work.*
>>
>> (IT_Manager is a resource object in my ontology)

-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: resource rdfs label

Posted by Martynas Jusevičius <ma...@graphity.org>.
You should not be looking at the URI as a label.

How did you try rdfs:label? Something like this should work:

SELECT *
WHERE
{
  ?x tre:has_boss tre:Good ;
    rdfs:label ?label .
}

Needs tre: and rdfs: PREFIXes of course.

On Mon, Apr 25, 2016 at 5:33 PM, mehmet mehmet <me...@gmail.com> wrote:
> This is my Jena query
>
> "SELECT * " + "WHERE {"  ?x tre:has_boss tre:Good." + "}" ;
>
> IT gives me correct answer but in URI form
>
> www.semanticweb/myontology/IT_Manager
>
> *I want just IT_Manager. I tried rdfs:label but does not work.*
>
> (IT_Manager is a resource object in my ontology)