This discussion is archived
0 Replies Latest reply: Aug 14, 2013 4:25 PM by damien.claveau RSS

Aliases/Prefixes and Percent-encoding URIs/IRIs

damien.claveau Newbie
Currently Being Moderated

My question (see below) was possibly a non-sense.

 

After further reading, I have concluded that, whatever the Sparql query engine (or endpoint) you use,
percent-encoding in the local part of a prefixed name is NOT allowed.

And one shoud consider the local part of a uri  NOT to be dereferenced.

 

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

 

Hi,

 

Our data comes from a relational source, and some IDs of resources initially contain illegal characters regarding to the rules of URIs.
Considering the recommandation http://www.w3.org/2011/rdf-wg/wiki/IRIs/RDFConceptsProposal,

we have used the built-in function “utl_url.ESCAPE” (and the symmetric function “utl_url.UNESCAPE”) to have conform URIs before bulk-loading.

This leads, for example, 'http://mydomain/cities#New York City'

         to be encoded into 'http://mydomain/cities#New%20York%20City'.

 

But, the execution of SEM_MATCH queries falls when using aliases/prefixes. The parser rejects the percent-encoding. (see example below)

 

Please, how can we use the PREFIX mechanisms in combination with this encoding ?

 

Damien

-------------------------------------------------
Scenario :

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

With the Partitioning, OLAP, Data Mining and Real Application Testing options

 

SQL> CREATE TABLE ADMWAT.CITIES_TPL(ID NUMBER, TRIPLE MDSYS.SDO_RDF_TRIPLE_S);

SQL> exec SEM_APIS.create_sem_model('CITIES', 'CITIES_TPL', 'triple');

SQL> INSERT INTO CITIES_TPL VALUES(1,sdo_rdf_triple_s('CITIES','http://mydomain/cities#New%20York%20City','http://www.w3.org/2000/01/rdf-schema#label','"NYC"'));

SQL> COMMIT;

 

SQL> SELECT p,o FROM TABLE(SEM_MATCH('{<http://mydomain/cities#New%20York%20City> ?p ?o}', SEM_Models('CITIES'), null, SEM_Aliases(SEM_Alias('cities','http://mydomain/cities#')), null));

P

----------------------------------------------------

O

----------------------------------------------------

http://www.w3.org/2000/01/rdf-schema#label

NYC

 

SQL> SELECT p,o FROM TABLE(SEM_MATCH('{cities:New%20York%20City ?p ?o}'                  , SEM_Models('CITIES'), null, SEM_Aliases(SEM_Alias('cities','http://mydomain/cities#')), null));

ERROR at line 1:

ORA-29532: Java call terminated by uncaught Java exception: oracle.spatial.rdf.server.TokenMgrError: Lexical error at line 1, column 12.  Encountered: "%" (37), after : ""

ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 244

ORA-06512: at "MDSYS.RDF_MATCH_IMPL_T", line 178

ORA-06512: at line 4

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points