cannata
(Phil Cannata)
1
How can I cast a literal object value to a URI that I can use as a predicate value?
I tried this:
prefix ais: <http://AIS.org/>
select *
where {
?i a ais:AssignmentContext .
?i ais:physical_column_name ?l .
?i uri(fn:concat("ais:", ?l))
}
but got an error.
Thanks
phil
jess
(Jess Balint)
2
Hi Phil!
The function you are looking for is called iri()
.
Best,
Jess
jess
(Jess Balint)
3
In the larger context of your query, you need to use BIND
in order to use the generated IRI as a predicate variable, e.g.:
BIND(iri(fn:concat("ais:", ?l)) AS ?pred)
?i ?pred ?obj
cannata
(Phil Cannata)
4
Thanks Jess, what do you use for the fn: prefix
cannata
(Phil Cannata)
5
I tried prefix fn: http://www.w3.org/2005/xpath-functions#concat
but got an internal server error.
cannata
(Phil Cannata)
6
CONCAT() is a builtin function so can also call it without any prefix just like you do with IRI()
cannata
(Phil Cannata)
8
Yes, that works nicely also.
Thanks
system
(system)
Closed
9
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.