On 23/07/13 17:53, Anthony Diniz wrote:
Thank you, Joshua.
My case is the 3rd one. Can you give me an example? I have foo:someIndividual, but I 
would like just "someIndividual", without having to process the answer as 
string with Java.

Thank you again,

Anthony


REPLACE(str(?YourVariable), '^.*(/|#)')

will calculate the local part for your example.

SELECT ... ?localName {
...
   BIND(REPLACE(str(?YourVariable), '^.*(/|#)') AS ?localName)
....
}


or
SELECT ... (REPLACE(str(?YourVariable), '^.*(/|#)') AS ?localName)
WHERE
{ ... }



Enviado via iPhone

Em 2013-07-23, às 12:24, Joshua TAYLOR <[email protected]> escreveu:

On Tue, Jul 23, 2013 at 9:57 AM, Anthony Ramalho
<[email protected]> wrote:
I'd like to know if somebody knows a way of hiding the prefix from results in 
SPARQL queries.
If yes, is it possible showing some kind of example?

What do you mean by "hiding the prefix"?

And how are you processing the results?  Using ResultSetFormatter?



1) Are you currently getting results like: foo:someIndividual but you
want <http://foo.com/.../someIndividual>, i.e., you want to to show
the full IRI, and not use a prefix?

2) Are you currently getting results like
<http://foo.com/.../someIndividual> and you want to hide the prefix
(of the IRI) "http://foo.com/.../"; and show foo:someIndividual
instead?

3) Are you currently getting results like
<http://foo.com/.../someIndividual> or foo:someIndividual, and you
want to just have someIndividual instead?

All three are possible, but they require different approaches.

//JT
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

Reply via email to