<docbook><section><title>VirtRDFViewsOracleHrDbScript</title><programlisting>-- Setup script for Linked Data Views of Oracle 10 Human Resources Sample Database --

GRANT SELECT 
   ON HR.orama.COUNTRIES 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot;
   ;
GRANT SELECT 
   ON HR.orama.REGIONS 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot;
   ;
GRANT SELECT 
   ON HR.orama.DEPARTMENTS 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot;
   ;
GRANT SELECT 
   ON HR.orama.LOCATIONS 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot;
   ;
GRANT SELECT 
   ON HR.orama.EMPLOYEES 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot;
   ;
GRANT SELECT 
   ON HR.orama.JOBS 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot;
   ;
GRANT SELECT 
   ON HR.orama.JOB_HISTORY 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot;
   ;

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

-------- Create rdfs:Class definitions ----------------------------

ttlp (
&#39;
@prefix rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
@prefix xsd: &lt;http://www.w3.org/2001/XMLSchema#&gt; .

@prefix hr: &lt;http://localhost:8890/schemas/oraclehr/&gt; .

hr:countries a rdfs:Class ;
   rdfs:isDefinedBy &lt;http://localhost:8890/schemas/oraclehr&gt; ;
   rdfs:label &quot;COUNTRIES&quot; ;
   rdfs:comment &quot;Oracle HR COUNTRIES table&quot; .

hr:country_id a rdf:Property ;
   rdfs:domain hr:countries ;
   rdfs:range xsd:string ;
   rdfs:label &quot;COUNTRY ID&quot; .

hr:country_name a rdf:Property ;
   rdfs:domain hr:countries ;
   rdfs:range xsd:string ;
   rdfs:label &quot;COUNTRY NAME&quot; .

hr:region_id a rdf:Property ;
   rdfs:domain hr:countries ;
   rdfs:range hr:regions ;
   rdfs:label &quot;REGION ID&quot; .

hr:regions a rdfs:Class ;
   rdfs:isDefinedBy &lt;http://localhost:8890/schemas/oraclehr&gt; ;
   rdfs:label &quot;REGIONS&quot; ;
   rdfs:comment &quot;Oracle HR REGIONS table&quot; .

hr:region_id a rdf:Property ;
   rdfs:domain hr:regions ;
   rdfs:range xsd:integer ;
   rdfs:label &quot;REGION ID&quot; .

hr:region_name a rdf:Property ;
   rdfs:domain hr:regions ;
   rdfs:range xsd:string ;
   rdfs:label &quot;REGION NAME&quot; .

hr:departments a rdfs:Class ;
   rdfs:isDefinedBy &lt;http://localhost:8890/schemas/oraclehr&gt; ;
   rdfs:label &quot;DEPARTMENTS&quot; ;
   rdfs:comment &quot;Oracle HR DEPARTMENT table&quot; .

hr:department_id a rdf:Property ;
   rdfs:domain hr:departments ;
   rdfs:range xsd:integer ;
   rdfs:label &quot;DEPARTMENT ID&quot; .

hr:department_name a rdf:Property ;
   rdfs:domain hr:departments ;
   rdfs:range xsd:string ;
   rdfs:comment &quot;DEPARTMENT NAME&quot; .

hr:manager_id a rdf:Property ;
   rdfs:domain hr:departments ;
   rdfs:range hr:employees ;
   rdfs:comment &quot;MANAGER ID&quot; .

hr:location_id a rdf:Property ;
   rdfs:domain hr:departments ;
   rdfs:range hr:locations ;
   rdfs:comment &quot;LOCATION ID&quot; .

hr:employees a rdfs:Class ;
   rdfs:isDefinedBy &lt;http://localhost:8890/schemas/oraclehr&gt; ;
   rdfs:label &quot;employees&quot; ;
   rdfs:comment &quot;Oracle HR EMPLOYEES table&quot; .

hr:employee_id a rdf:Property ;
   rdfs:domain hr:employees;
   rdfs:range xsd:integer ;
   rdfs:label &quot;EMPLOYEE ID&quot; .

hr:first_name a rdf:Property ;
   rdfs:domain hr:employees;
   rdfs:range xsd:string ;
   rdfs:label &quot;FIRST NAME&quot; .

hr:last_name a rdf:Property ;
   rdfs:domain hr:employees ;
   rdfs:range xsd:string ;
   rdfs:label &quot;LAST NAME&quot; .

hr:email a rdf:Property ;
   rdfs:domain hr:employees;
   rdfs:range xsd:string ;
   rdfs:label &quot;EMAIL&quot; .

hr:phone_number a rdf:Property ;
   rdfs:domain hr:employees ;
   rdfs:range xsd:string ;
   rdfs:label &quot;PHONE NUMBER&quot; .

hr:hire_date a rdf:Property ;
   rdfs:domain hr:employees ;
   rdfs:range xsd:date ;
   rdfs:label &quot;HIRE DATE&quot; .

hr:job_id a rdf:Property ;
   rdfs:domain hr:employees;
   rdfs:range hr:jobs ;
   rdfs:label &quot;JOB ID&quot; .

hr:salary a rdf:Property ;
   rdfs:domain hr:employees ;
   rdfs:range xsd:integer ;
   rdfs:label &quot;SALARY&quot; .

hr:commission_pct a rdf:Property ;
   rdfs:domain hr:employees ;
   rdfs:range xsd:integer ;
   rdfs:label &quot;COMMISSION PCT&quot; .

hr:manager_id a rdf:Property ;
   rdfs:domain hr:employees ;
   rdfs:range xsd:string ;
   rdfs:label &quot;MANAGER ID&quot; .

hr:department_id a rdf:Property ;
   rdfs:domain hr:employees ;
   rdfs:range hr:departments ;
   rdfs:label &quot;DEPARTMENT ID&quot; .

hr:jobs a rdfs:Class ;
   rdfs:isDefinedBy &lt;http://localhost:8890/schemas/oraclehr&gt; ;
   rdfs:label &quot;JOBS&quot; ;
   rdfs:comment &quot;Oracle HR JOBS table&quot; .

hr:job_id a rdf:Property ;

   rdfs:domain hr:jobs ;
   rdfs:range xsd:string ;
   rdfs:label &quot;JOB ID&quot; .

hr:job_title a rdf:Property ;
   rdfs:domain hr:jobs ;
   rdfs:range xsd:string ;
   rdfs:label &quot;JOB TITLE&quot; .

hr:min_salary a rdf:Property ;
   rdfs:domain hr:jobs ;
   rdfs:range xsd:number;
   rdfs:label &quot;MIN SALARY&quot; .

hr:max_salary a rdf:Property ;
   rdfs:domain hr:jobs ;
   rdfs:range xsd:number;
   rdfs:label &quot;MAXSALARY&quot; .

hr:job_history a rdfs:Class ;
   rdfs:isDefinedBy &lt;http://localhost:8890/schemas/oraclehr&gt; ;
   rdfs:label &quot;JOB HISTORY&quot; ;
   rdfs:comment &quot;Oracle HR JOB HISTORY table&quot; .

hr:employee_id a rdf:Property ;
   rdfs:domain hr:job_history ;
   rdfs:range hr:employees ;
   rdfs:label &quot;EMPLOYEE ID&quot; .

hr:start_date a rdf:Property ;
   rdfs:domain hr:job_history ;
   rdfs:range xsd:date ;
   rdfs:label &quot;START DATE&quot; .

hr:end_date a rdf:Property ;
   rdfs:domain hr:job_history ;
   rdfs:range xsd:date ;
   rdfs:label &quot;END DATE&quot; .

hr:job_id a rdf:Property ;
   rdfs:domain hr:job_history ;
   rdfs:range hr:jobs ;
   rdfs:label &quot;JOB ID&quot; .

hr:department_id a rdf:Property ;
   rdfs:domain hr:job_history ;
   rdfs:range hr:departments ;
   rdfs:label &quot;DEPARTMENT ID&quot; .

hr:locations a rdfs:Class ;
   rdfs:isDefinedBy &lt;http://localhost:8890/schemas/oraclehr&gt; ;
   rdfs:label &quot;LOCATIONS&quot; ;
   rdfs:comment &quot;Oracle HR JOB LOCATIONS table&quot; .

hr:location_id a rdf:Property ;
   rdfs:domain hr:locations ;
   rdfs:range xsd:number ;
   rdfs:label &quot;LOCATION ID&quot; .

hr:street_address a rdf:Property ;
   rdfs:domain hr:locations ;
   rdfs:range xsd:string ;
   rdfs:label &quot;STREET ADDRESS&quot; .

hr:postal_code a rdf:Property ;
   rdfs:domain hr:locations ;
   rdfs:range xsd:string ;
   rdfs:label &quot;POSTAL CODE&quot; .

hr:city a rdf:Property ;
   rdfs:domain hr:locations ;
   rdfs:range xsd:string ;
   rdfs:label &quot;CITY&quot; .

hr:state_province a rdf:Property ;
   rdfs:domain hr:locations ;
   rdfs:range xsd:string ;
   rdfs:label &quot;STATE PROVINCE&quot; .

hr:country_id a rdf:Property ;
   rdfs:domain hr:locations ;
   rdfs:range hr:countries ;
   rdfs:label &quot;COUNTRY&quot; .
&#39;, &#39;&#39;, &#39;http://localhost:8890/schemas/oraclehr&#39;, 0);

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

----------- Create IRI Classes -------------

CREATE FUNCTION DB.DBA.JOB_HISTORY 
   ( 
     IN  EMPLOYEE_ID  INTEGER, 
     IN  START_DATE   DATE
   ) 
   RETURNS VARCHAR
      {
        RETURN sprintf_or_null
           ( &#39;http://localhost:8890/oraclehr/job_history/%d_%s#this&#39;,
             EMPLOYEE_ID, 
             CAST (START_DATE AS VARCHAR) 
           )
        ;
      }
   ;

CREATE FUNCTION DB.DBA.JOB_HISTORY_INV_1 
   ( 
     IN  id  VARCHAR 
   ) 
   RETURNS INTEGER
      {
        RETURN sprintf_inverse 
           ( 
             id,
             &#39;http://localhost:8890/oraclehr/job_history/%d_%s#this&#39;,
             2
           ) 
        [0];
      }
   ;

CREATE FUNCTION DB.DBA.JOB_HISTORY_INV_2 
   (
     IN id VARCHAR
   ) 
   RETURNS DATE
      {
        DECLARE EXIT HANDLER FOR SQLSTATE &#39;*&#39; 
           { 
             RETURN NULL; 
           }
        ;
        RETURN 
           CAST ( sprintf_inverse 
                    (
                      id,
                      &#39;http://localhost:8890/oraclehr/job_history/%d_%s#this&#39;,
                      2
                    )
                  [1] AS DATE
                )
           ;
      }
   ;


GRANT EXECUTE 
   ON DB.DBA.JOB_HISTORY 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot; 
   ;
   
GRANT EXECUTE 
   ON DB.DBA.JOB_HISTORY_URI_INV_1 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot; 
   ;
   
GRANT EXECUTE 
   ON DB.DBA.JOB_HISTORY_URI_INV_2 
   TO &quot;SPARQL&quot;, 
      &quot;SPARQL_UPDATE&quot; 
   ;

sparql

   CREATE IRI CLASS 
      &lt;http://localhost:8890/schemas/oraclehr/countries_iri&gt; 
      &quot;http://^{URIQADefaultHost}^/oraclehr/countries/%s#this&quot;
      ( IN  COUNTRY_ID    VARCHAR NOT NULL ) 
      .

   CREATE IRI CLASS 
      &lt;http://localhost:8890/schemas/oraclehr/regions_iri&gt;
      &quot;http://^{URIQADefaultHost}^/oraclehr/regions/%d#this&quot;
      ( IN  REGION_ID     INTEGER NOT NULL ) 
      .

   CREATE IRI CLASS 
      &lt;http://localhost:8890/schemas/oraclehr/departments_iri&gt;
      &quot;http://^{URIQADefaultHost}^/oraclehr/departments/%d#this&quot;
      ( IN  DEPARTMENT_ID INTEGER NOT NULL ) 
      .

   CREATE IRI CLASS 
      &lt;http://localhost:8890/schemas/oraclehr/employees_iri&gt; 
      &quot;http://^{URIQADefaultHost}^/oraclehr/employees/%d#this&quot;
      ( IN  EMPLOYEE_ID   INTEGER NOT NULL ) 
      .

   CREATE IRI CLASS 
      &lt;http://localhost:8890/schemas/oraclehr/jobs_iri&gt;
      &quot;http://^{URIQADefaultHost}^/oraclehr/jobs/%s#this&quot;
      ( IN  JOB_ID        VARCHAR NOT NULL ) 
      .

   CREATE IRI CLASS 
      &lt;http://localhost:8890/schemas/oraclehr/job_history_iri&gt;
      USING 
         FUNCTION DB.DBA.JOB_HISTORY 
            (
              IN  EMPLOYEE_ID  INTEGER NOT NULL, 
              IN  START_DATE   DATE NOT NULL
            ) 
            RETURNS  VARCHAR NOT NULL,
         FUNCTION DB.DBA.JOB_HISTORY_INV_1 
            (
              IN  id           VARCHAR
            ) 
            RETURNS  INTEGER,
         FUNCTION DB.DBA.JOB_HISTORY_INV_2 
            (
              IN id VARCHAR
            ) 
            RETURNS  DATE 
               OPTION 
                  ( 
                    bijection, 
                    RETURNS &quot;http://localhost:8890/oraclehr/job_history/%d_%s#this&quot;
                  ) 
      .

   CREATE IRI CLASS 
      &lt;http://localhost:8890/schemas/oraclehr/locations_iri&gt; 
      &quot;http://^{URIQADefaultHost}^/oraclehr/locations/%d#this&quot;
      ( IN  LOCATION_ID  INTEGER NOT NULL ) 
      .
   ;

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

------------- Create Quad Store ------------------------------------

sparql

   PREFIX hr: &lt;http://localhost:8890/schemas/oraclehr/&gt;

   ALTER QUAD STORAGE virtrdf:DefaultQuadStorage 
      FROM  HR.orama.COUNTRIES    AS  countries_tbl 
      FROM  HR.orama.REGIONS      AS  regions_tbl
      FROM  HR.orama.DEPARTMENTS  AS  departments_tbl
      FROM  HR.orama.EMPLOYEES    AS  employees_tbl
      FROM  HR.orama.EMPLOYEES    AS  employees_tbl_1      ### alias required to represent recursive FK relationship ( hr: has_manager ) below.
      FROM  HR.orama.JOBS         AS  jobs_tbl
      FROM  HR.orama.JOB_HISTORY  AS  job_history_tbl
      FROM  HR.orama.LOCATIONS    AS  locations_tbl
      {
        CREATE virtrdf:oraclehr  
           AS GRAPH &lt;http://localhost:8890/oraclehr&gt;
           {
             hr:countries_iri(countries_tbl.COUNTRY_ID)
                a   hr:countries  
                AS  virtrdf:countires_country_id 
                       ;
                    hr:country_name countries_tbl.COUNTRY_NAME  
                       AS virtrdf:countries_country_name 
                       ;
                    hr:region_id hr:regions_iri(regions_tbl.REGION_ID) 
                       WHERE ( ^{countries_tbl.}^.REGION_ID = ^{regions_tbl.}^.REGION_ID )  
                       AS virtrdf:countries_region_id 
                .

             hr:regions_iri(regions_tbl.REGION_ID)
                a   hr:regions 
                AS  virtrdf:regions_region_id 
                       ;
                    hr:region_name regions_tbl.REGION_NAME  
                       AS virtrdf:regions_region_name 
                .

             hr:departments_iri(departments_tbl.DEPARTMENT_ID)
                a   hr:departments 
                AS  virtrdf:departments_department_id 
                       ;
                    hr:department_name 
                       departments_tbl.DEPARTMENT_NAME 
                          AS virtrdf:departments_department_name 
                       ;
                    hr:location_id 
                       hr:locations_iri(locations_tbl.LOCATION_ID) 
                          WHERE (^{departments_tbl.}^.LOCATION_ID = ^{locations_tbl.}^.LOCATION_ID) 
                          AS virtrdf:departments_location_id 
                       ;
                    hr:manager_id 
                       hr:employees_iri(employees_tbl.EMPLOYEE_ID) 
                          WHERE (^{departments_tbl.}^.MANAGER_ID = ^{employees_tbl.}^.EMPLOYEE_ID) 
                          AS virtrdf:departments_manager_id 
                .

             hr:employees_iri(employees_tbl.EMPLOYEE_ID)        
                a   hr:employees 
                AS  virtrdf:employees_employee_id 
                       ;
                    hr:department_id 
                       hr:departments_iri(departments_tbl.DEPARTMENT_ID) 
                          WHERE (^{employees_tbl.}^.DEPARTMENT_ID = ^{departments_tbl.}^.DEPARTMENT_ID) 
                          AS virtrdf:employees_department_id 
                       ;
                    hr:job_id
                       hr:jobs_iri(jobs_tbl.JOB_ID) 
                          WHERE (^{employees_tbl.}^.JOB_ID = ^{jobs_tbl.}^.JOB_ID) 
                          AS virtrdf:employees_job_id 
                       ;
                    hr:manager_id 
                       employees_tbl.MANAGER_ID 
                          AS virtrdf:employees_manager_id 
                       ;
                    hr:commissin_pct
                       employees_tbl.COMMISSION_PCT 
                          AS virtrdf:employees_commission_pct 
                       ;
                    hr:email 
                       employees_tbl.EMAIL 
                          AS virtrdf:employees_email 
                       ;
                    hr:first_name
                       employees_tbl.FIRST_NAME 
                          AS virtrdf:employees_first_name 
                       ;
                    hr:hire_date
                       employees_tbl.HIRE_DATE 
                          AS virtrdf:employees_hire_date 
                       ;
                    hr:last_name
                       employees_tbl.LAST_NAME 
                          AS virtrdf:employees_last_name 
                       ;
                    hr:phone_number
                       employees_tbl.PHONE_NUMBER 
                          AS virtrdf:employees_phone_number 
                       ;
                    hr:salary
                       employees_tbl.SALARY 
                          AS virtrdf:employees_salary 
                       ;
                    hr:has_job_history
                       hr:job_history_iri 
                          ( 
                            job_history_tbl.EMPLOYEE_ID, 
                            job_history_tbl.START_DATE
                          ) 
                          WHERE (^{employees_tbl.}^.EMPLOYEE_ID = ^{job_history_tbl.}^.EMPLOYEE_ID) 
                          AS virtrdf:employees_has_job_history
                       ;
                    hr:has_manager
                       hr:employees_iri(employees_tbl_1.EMPLOYEE_ID) 
                          WHERE (^{employees_tbl.}^.MANAGER_ID = ^{employees_tbl_1.}^.EMPLOYEE_ID) 
                          AS virtrdf:employees_has_manager
                .

             hr:locations_iri(locations_tbl.LOCATION_ID) 
                a   hr:locations 
                AS  virtrdf:locations_location_id 
                       ;
                    hr:country_id 
                       hr:countries_iri(countries_tbl.COUNTRY_ID) 
                          WHERE (^{locations_tbl.}^.COUNTRY_ID = ^{countries_tbl.}^.COUNTRY_ID) 
                          AS virtrdf:locations_country_id 
                       ;
                    hr:city 
                       locations_tbl.CITY 
                          AS virtrdf:locations_city 
                       ;
                    hr:postal_code 
                       locations_tbl.POSTAL_CODE
                          AS virtrdf:locations_postal_code 
                       ;
                    hr:state_province 
                       locations_tbl.STATE_PROVINCE
                          AS virtrdf:locations_state_province 
                       ;
                    hr:street_address
                       locations_tbl.STREET_ADDRESS 
                          AS virtrdf:locations_street_address 
                .

             hr:jobs_iri(jobs_tbl.JOB_ID) 
                a   hr:jobs 
                AS  virtrdf:jobs_job_id 
                       ;
                    hr:job_title 
                       jobs_tbl.JOB_TITLE 
                          AS virtrdf:jobs_job_title 
                       ;
                    hr:max_salary 
                       jobs_tbl.MAX_SALARY
                          AS virtrdf:jobs_max_salary 
                       ;
                    hr:min_salary
                       jobs_tbl.MIN_SALARY
                          AS virtrdf:jobs_min_salary 
                .

             hr:job_history_iri(job_history_tbl.EMPLOYEE_ID, job_history_tbl.START_DATE) 
                a   hr:job_history 
                AS  virtrdf:job_history_pk 
                       ;
                    hr:employee_id 
                       hr:employees_iri(employees_tbl.EMPLOYEE_ID) 
                          WHERE (^{job_history_tbl.}^.EMPLOYEE_ID = ^{employees_tbl.}^.EMPLOYEE_ID) 
                          AS virtrdf:job_history_employee_id 
                       ;
                    hr:department_id
                       hr:departments_iri(departments_tbl.DEPARTMENT_ID) 
                          WHERE (^{job_history_tbl.}^.DEPARTMENT_ID = ^{departments_tbl.}^.DEPARTMENT_ID) 
                          AS virtrdf:job_history_department_id 
                       ;
                    hr:job_id
                       hr:jobs_iri(jobs_tbl.JOB_ID) 
                          WHERE (^{job_history_tbl.}^.JOB_ID = ^{jobs_tbl.}^.JOB_ID) 
                          AS virtrdf:job_history_job_id 
                       ;
                    hr:start_date
                       job_history_tbl.START_DATE 
                          AS virtrdf:job_history_start_date 
                       ;
                    hr:end_date
                       job_history_tbl.END_DATE 
                          AS virtrdf:job_history_end_date 
                .

           } 
           .
      } 
      .
   ;

DELETE
   FROM db.dba.url_rewrite_rule_list 
   WHERE urrl_list 
      LIKE &#39;oraclehr_rule%&#39;
   ;
DELETE
   FROM db.dba.url_rewrite_rule 
   WHERE urr_rule 
      LIKE &#39;oraclehr_rule%&#39;
   ;

DB.DBA.URLREWRITE_CREATE_REGEX_RULE 
   (
     &#39;oraclehr_rule1&#39;,
     1,
     &#39;(/[^#]*)&#39;,
     VECTOR(&#39;path&#39;),
     1,
     &#39;/about/html/http/^{URIQADefaultHost}^%s&#39;,
     VECTOR(&#39;path&#39;),
     NULL,
     &#39;(text/html)|(\\*/\\*)&#39;,
     0,
     303
   )
   ;


DB.DBA.URLREWRITE_CREATE_REGEX_RULE 
   (
     &#39;oraclehr_rule2&#39;,
     1,
     &#39;(/[^#]*)&#39;,
     VECTOR(&#39;path&#39;),
     1,
     &#39;/sparql?query=DESCRIBE+%%3Chttp%%3A//localhost%%3A8890%U%%23this%%3E+%%3Chttp%%3A//localhost%%3A8890%U%%23this%%3E+FROM+%%3Chttp%%3A//localhost%%3A8890/oraclehr%%3E&amp;format=%U&#39;,
     VECTOR(&#39;path&#39;, &#39;path&#39;, &#39;*accept*&#39;),
     NULL,
     &#39;(text/rdf.n3)|(application/rdf.xml)&#39;,
     0,
     NULL
   )
   ;

DB.DBA.URLREWRITE_CREATE_RULELIST 
   (
     &#39;oraclehr_rule_list1&#39;,
     1,
     VECTOR 
        (
          &#39;oraclehr_rule1&#39;,
          &#39;oraclehr_rule2&#39;
        )
   )
   ;

-- ensure a VD for the IRIs which begins with /
VHOST_REMOVE (lpath=&gt;&#39;/oraclehr&#39;);

VHOST_DEFINE 
   (
     lpath=&gt;&#39;/oraclehr&#39;,
     ppath=&gt;&#39;/DAV/oraclehr/&#39;, 
        is_dav=&gt;1, 
     vsp_user=&gt;&#39;dba&#39;, 
     is_brws=&gt;0, 
     opts=&gt;VECTOR (&#39;url_rewrite&#39;, &#39;oraclehr_rule_list1&#39;) 
   )
   ;

DELETE 
   FROM db.dba.url_rewrite_rule_list 
   WHERE urrl_list 
      LIKE &#39;oracle_schemas_rule%&#39;
   ;
DELETE
   FROM db.dba.url_rewrite_rule 
   WHERE urr_rule 
      LIKE &#39;oracle_schemas_rule%&#39;
   ;

DB.DBA.URLREWRITE_CREATE_REGEX_RULE 
   (
     &#39;oracle_schemas_rule1&#39;,
     1,
     &#39;(/[^#]*)&#39;,
     VECTOR(&#39;path&#39;),
     1,
     &#39;/about/html/http/^{URIQADefaultHost}^%s&#39;,
     VECTOR(&#39;path&#39;),
     NULL,
     &#39;(text/html)|(\\*/\\*)&#39;,
     0,
     303
   )
   ;

DB.DBA.URLREWRITE_CREATE_REGEX_RULE 
   (
     &#39;oracle_schemas_rule2&#39;,
     1,
     &#39;(/[^#]*)&#39;,
     VECTOR(&#39;path&#39;),
     1,
     &#39;/sparql?query=CONSTRUCT+{+%%3Chttp%%3A//localhost%%3A8890%U%%3E+%%3Fp+%%3Fo+}%%0D%%0AFROM+%%3Chttp%%3A//localhost%%3A8890/schemas/oraclehr%%3E+%%0D%%0AWHERE+{+%%3Chttp%%3A//localhost%%3A8890%U%%3E+%%3Fp+%%3Fo+}&amp;format=%U&#39;,
     VECTOR(&#39;path&#39;,&#39;path&#39;,&#39;*accept*&#39;),
     NULL,
     &#39;(text/rdf.n3)|(application/rdf.xml)&#39;,
     0,
     NULL
   )
   ;

DB.DBA.URLREWRITE_CREATE_RULELIST 
   (
     &#39;oracle_schemas_rule_list1&#39;,
     1,
     VECTOR 
        (
          &#39;oracle_schemas_rule1&#39;,
          &#39;oracle_schemas_rule2&#39;
        )
   )
   ;

-- ensure a VD for the IRIs which begins with /
VHOST_REMOVE (lpath=&gt;&#39;/schema/oraclehr&#39;);

VHOST_DEFINE 
   (
     lpath=&gt;&#39;/schemas/oraclehr&#39;,
     ppath=&gt;&#39;/DAV/schemas/oraclehr/&#39;, 
        is_dav=&gt;1, 
     vsp_user=&gt;&#39;dba&#39;, 
     is_brws=&gt;0, 
     opts=&gt;VECTOR (&#39;url_rewrite&#39;, &#39;oracle_schemas_rule_list1&#39;) 
   )
   ;

DB.DBA.XML_SET_NS_DECL 
   (
     &#39;hr&#39;, 
     &#39;http://^{URIQADefaultHost}^/schemas/oraclehr/&#39;, 
     2
   )
   ;

</programlisting></section></docbook>