Hello Lars,

Opps, some portion of virtuoso function docs is lost in compilation.
While it's being recovered, the brief summary of functions is here:

bool isiri_id (in arg any): returns 1 if arg is an IRI_ID of an IRI of
any sort (named or blank node), 0 otherwise.

bool is_named_iri_id (in arg any): returns 1 if arg is an IRI_ID of a
"plain" IRI of any sort, 0 if arg is IRI_ID of blank node or value of
some other type.

bool is_bnode_iri_id (in arg any): returns 1 if arg is an IRI_ID of a
"plain" IRI of any sort, 0 if arg is IRI_ID of blank node or value of
some other type.

integer iri_id_num (in arg IRI_ID): returns numeric value of IRI_ID
IRI_ID iri_id_from_num (in arg integer): returns IRI_ID with the
specified numeric value.

IRI_ID iri_to_id (in iri_text varchar): returns an IRI_ID for a given
iri_text. The encoding of iri_text is supposed to be UTF-8. If the
function is called for the first time with the specified iri_text value
then a new IRI_ID is "allocated" and the pair of text and ID is stored
in system tables and cached in memory. If the passed iri_text value is
known to the system already then the ID assigned at the first use is
returned again. Wrong type of iri_text results in an error, the
exception is iri_to_id (NULL) that is NULL without an error.

IRI_ID iri_to_id_nosignal (in iri_text varchar, [in make_new bool, [in
fallback any]]): returns and IRI_ID like iri_to_id() does, but
"_nosignal" version does not signal error if the argument is invalid ---
It returns fallback value if it is passed as third argument or NULL if
no third argument at all.
If second argument is zero then fallback value is also returned if the
IRI_ID for iri_text was never allocated. If second argument is one or
missing then iri_to_id_nosignal() allocates new IRI_IDs like
iri_to_id().

varchar id_to_iri (in arg IRI_ID): converts previously allocated IRI_ID
argument to the UTF-8 string. The resulting string has "box flag" equal
to to 1, indicating that is is made from IRI_ID and it's supposed to be
UTF-8.

varchar id_to_iri_nosignal (in arg any): similar to id_to_iri(), but it
never signal errors, it return NULL instead.


Last two functions of the list is what you need.

Best Regards,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com

On Thu, 2011-10-06 at 09:36 +0200, Lars Marius Garshol wrote:
> We have a changelog table built from RDF_QUAD by triggers. Now I need to 
> clear out the log for one particular graph. Basically, I need to do
> 
>   delete from RDF_LOG where G = 'http://...'
> 
> But G is IRI_ID. So I really need to do
> 
>   delete from RDF_LOG where G = convert_iri_id_to_uri('http://...')
> 
> I've tried searching the docs over and over, googling etc etc, but I just 
> can't find any way to do it. There is a SPARQL function for it, I found, 
> called rdfdf:default_iid but I can't seem to reach that in SQL.
> 
> Help please!
> 
> --Lars M.
> http://www.garshol.priv.no/tmphoto/
> http://www.garshol.priv.no/blog/



Reply via email to