[Mulgara-svn] r951 - in trunk: jxdata/iTQL/data_types jxdata/iTQL/data_types/binary/base64Binary jxdata/iTQL/data_types/binary/hexBinary jxdata/iTQL/data_types/boolean jxdata/iTQL/data_types/dateTime jxdata/iTQL/data_types/gDates src/jar/query/java/org/mulgara/query/rdf src/jar/resolver-xsd/java/org/mulgara/resolver/xsd
pag at mulgara.org
pag at mulgara.org
Fri May 16 22:35:48 UTC 2008
Author: pag
Date: 2008-05-16 15:35:47 -0700 (Fri, 16 May 2008)
New Revision: 951
Modified:
trunk/jxdata/iTQL/data_types/binary/base64Binary/result1.txt
trunk/jxdata/iTQL/data_types/binary/base64Binary/test.jxu
trunk/jxdata/iTQL/data_types/binary/hexBinary/result1.txt
trunk/jxdata/iTQL/data_types/binary/hexBinary/test.jxu
trunk/jxdata/iTQL/data_types/boolean/result1.txt
trunk/jxdata/iTQL/data_types/boolean/test.jxu
trunk/jxdata/iTQL/data_types/dateTime/test.jxu
trunk/jxdata/iTQL/data_types/gDates/result1.txt
trunk/jxdata/iTQL/data_types/gDates/test.jxu
trunk/jxdata/iTQL/data_types/result1.txt
trunk/jxdata/iTQL/data_types/test.jxu
trunk/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java
trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java
trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolverFactory.java
Log:
Created default graph of sys:xsd for the XSDResolver
Modified: trunk/jxdata/iTQL/data_types/binary/base64Binary/result1.txt
===================================================================
--- trunk/jxdata/iTQL/data_types/binary/base64Binary/result1.txt 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/binary/base64Binary/result1.txt 2008-05-16 22:35:47 UTC (rev 951)
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully dropped graph @server@#xsdmodel</message></query><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
+<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
Modified: trunk/jxdata/iTQL/data_types/binary/base64Binary/test.jxu
===================================================================
--- trunk/jxdata/iTQL/data_types/binary/base64Binary/test.jxu 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/binary/base64Binary/test.jxu 2008-05-16 22:35:47 UTC (rev 951)
@@ -2,13 +2,8 @@
<set name="debug" value="false" />
- <!-- Configure the data type model -->
- <set name="query" value="
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- drop <@server@#xsdmodel> ;
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- alias <http://mulgara.org/mulgara#> as exp ;
- "/>
+ <!-- Configure an alias for the Mulgara domain -->
+ <set name="query" value="alias <http://mulgara.org/mulgara#> as exp ;"/>
<eval stepClass="org.mulgara.store.jxunit.QueryJX" />
<ifEqual converse="true" file="result1.txt" name="queryResult">
Modified: trunk/jxdata/iTQL/data_types/binary/hexBinary/result1.txt
===================================================================
--- trunk/jxdata/iTQL/data_types/binary/hexBinary/result1.txt 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/binary/hexBinary/result1.txt 2008-05-16 22:35:47 UTC (rev 951)
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully dropped graph @server@#xsdmodel</message></query><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
+<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
Modified: trunk/jxdata/iTQL/data_types/binary/hexBinary/test.jxu
===================================================================
--- trunk/jxdata/iTQL/data_types/binary/hexBinary/test.jxu 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/binary/hexBinary/test.jxu 2008-05-16 22:35:47 UTC (rev 951)
@@ -3,12 +3,7 @@
<!-- Configure the data type model -->
- <set name="query" value="
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- drop <@server@#xsdmodel> ;
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- alias <http://mulgara.org/mulgara#> as exp ;
- "/>
+ <set name="query" value="alias <http://mulgara.org/mulgara#> as exp ;"/>
<eval stepClass="org.mulgara.store.jxunit.QueryJX" />
<ifEqual converse="true" file="result1.txt" name="queryResult">
Modified: trunk/jxdata/iTQL/data_types/boolean/result1.txt
===================================================================
--- trunk/jxdata/iTQL/data_types/boolean/result1.txt 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/boolean/result1.txt 2008-05-16 22:35:47 UTC (rev 951)
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully dropped graph @server@#xsdmodel</message></query><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
+<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
Modified: trunk/jxdata/iTQL/data_types/boolean/test.jxu
===================================================================
--- trunk/jxdata/iTQL/data_types/boolean/test.jxu 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/boolean/test.jxu 2008-05-16 22:35:47 UTC (rev 951)
@@ -3,12 +3,7 @@
<!-- Configure the data type model -->
- <set name="query" value="
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- drop <@server@#xsdmodel> ;
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- alias <http://mulgara.org/mulgara#> as exp ;
- "/>
+ <set name="query" value="alias <http://mulgara.org/mulgara#> as exp ;"/>
<eval stepClass="org.mulgara.store.jxunit.QueryJX" />
<ifEqual converse="true" file="result1.txt" name="queryResult">
Modified: trunk/jxdata/iTQL/data_types/dateTime/test.jxu
===================================================================
--- trunk/jxdata/iTQL/data_types/dateTime/test.jxu 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/dateTime/test.jxu 2008-05-16 22:35:47 UTC (rev 951)
@@ -5,7 +5,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -22,7 +22,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -39,7 +39,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#after> '2004-12-01' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#after> '2004-12-01' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -55,7 +55,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#before> '2004-01-01' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-01-01' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -71,7 +71,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#after> '2004-12-31' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#after> '2004-12-31' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -87,7 +87,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#after> '2003-12-31' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#after> '2003-12-31' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -103,7 +103,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#before> '2005-01-01' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#before> '2005-01-01' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -120,7 +120,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#before> '2004-01-02' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-01-02' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -138,7 +138,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#gt> '-1' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#gt> '-1' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -156,8 +156,8 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#after> '2004-03-01' in <@server@#xsdmodel> and
- $date2 <http://mulgara.org/mulgara#before> '2004-06-30' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#after> '2004-03-01' in <sys:xsd> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-06-30' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -173,8 +173,8 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#after> '2004-06-30' in <@server@#xsdmodel> and
- $date2 <http://mulgara.org/mulgara#before> '2004-03-01' in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#after> '2004-06-30' in <sys:xsd> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-03-01' in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -192,24 +192,24 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#lt> '10' in <@server@#xsdmodel> and
- $value2 <http://mulgara.org/mulgara#gt> '1' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#lt> '10' in <sys:xsd> and
+ $value2 <http://mulgara.org/mulgara#gt> '1' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
delete select $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#lt> '10' in <@server@#xsdmodel> and
- $value2 <http://mulgara.org/mulgara#gt> '1' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#lt> '10' in <sys:xsd> and
+ $value2 <http://mulgara.org/mulgara#gt> '1' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
from <@server@#numbers> ;
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#lt> '10' in <@server@#xsdmodel> and
- $value2 <http://mulgara.org/mulgara#gt> '1' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#lt> '10' in <sys:xsd> and
+ $value2 <http://mulgara.org/mulgara#gt> '1' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
@@ -227,7 +227,7 @@
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
$value2 <http://mulgara.org/mulgara#is>
- '11'^^<http://www.w3.org/2001/XMLSchema#double> in <@server@#xsdmodel> and
+ '11'^^<http://www.w3.org/2001/XMLSchema#double> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
@@ -235,7 +235,7 @@
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
$value2 <http://mulgara.org/mulgara#is>
- '11'^^<http://www.w3.org/2001/XMLSchema#double> in <@server@#xsdmodel> and
+ '11'^^<http://www.w3.org/2001/XMLSchema#double> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
from <@server@#numbers> ;
@@ -243,7 +243,7 @@
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
$value2 <http://mulgara.org/mulgara#is>
- '11'^^<http://www.w3.org/2001/XMLSchema#double> in <@server@#xsdmodel> and
+ '11'^^<http://www.w3.org/2001/XMLSchema#double> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
@@ -261,7 +261,7 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
@@ -269,14 +269,14 @@
delete select $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
from <@server@#dates> ;
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#before> '2004-03-01'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
@@ -294,21 +294,21 @@
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
delete select $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
from <@server@#dates> ;
select $label
from <@server@#dates>
where $date <http://www.w3.org/2002/07/owl#sameIndividualAs> $date2 and
- $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <@server@#xsdmodel> and
+ $date2 <http://mulgara.org/mulgara#is> '2004-12-25'^^<http://www.w3.org/2001/XMLSchema#date> in <sys:xsd> and
$date <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -342,7 +342,7 @@
where $s <urn:test:foo> $dateTime
and $dateTime <http://mulgara.org/mulgara#after>
'2005-01-01T12:16:59'^^<http://www.w3.org/2001/XMLSchema#dateTime> in
- <@server@#xsdmodel>
+ <sys:xsd>
order by $dateTime ;
"/>
@@ -359,7 +359,7 @@
where $s <urn:test:foo> $dateTime
and $dateTime <http://mulgara.org/mulgara#before>
'2005-01-01T12:17:00.04'^^<http://www.w3.org/2001/XMLSchema#dateTime> in
- <@server@#xsdmodel>
+ <sys:xsd>
order by $dateTime ;
"/>
@@ -376,7 +376,7 @@
where $s <urn:test:foo> $dateTime
and $dateTime <http://mulgara.org/mulgara#after>
'2005-01-01T12:17:59.99'^^<http://www.w3.org/2001/XMLSchema#dateTime> in
- <@server@#xsdmodel>
+ <sys:xsd>
order by $dateTime ;
"/>
@@ -393,10 +393,10 @@
where $s <urn:test:foo> $dateTime
and $dateTime <http://mulgara.org/mulgara#after>
'2005-01-01T12:17:00.000'^^<http://www.w3.org/2001/XMLSchema#dateTime> in
- <@server@#xsdmodel>
+ <sys:xsd>
and $dateTime <http://mulgara.org/mulgara#before>
'2005-01-01T12:17:00.010'^^<http://www.w3.org/2001/XMLSchema#dateTime> in
- <@server@#xsdmodel>
+ <sys:xsd>
order by $dateTime ;
"/>
@@ -413,10 +413,10 @@
where $s <urn:test:foo> $dateTime
and $dateTime <http://mulgara.org/mulgara#after>
'2005-01-01T12:17:00.01'^^<http://www.w3.org/2001/XMLSchema#dateTime> in
- <@server@#xsdmodel>
+ <sys:xsd>
and $dateTime <http://mulgara.org/mulgara#before>
'2005-01-01T12:17:00.06'^^<http://www.w3.org/2001/XMLSchema#dateTime> in
- <@server@#xsdmodel>
+ <sys:xsd>
order by $dateTime ;
"/>
Modified: trunk/jxdata/iTQL/data_types/gDates/result1.txt
===================================================================
--- trunk/jxdata/iTQL/data_types/gDates/result1.txt 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/gDates/result1.txt 2008-05-16 22:35:47 UTC (rev 951)
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully dropped graph @server@#xsdmodel</message></query><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
+<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
Modified: trunk/jxdata/iTQL/data_types/gDates/test.jxu
===================================================================
--- trunk/jxdata/iTQL/data_types/gDates/test.jxu 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/gDates/test.jxu 2008-05-16 22:35:47 UTC (rev 951)
@@ -3,12 +3,7 @@
<!-- Configure the data type model -->
- <set name="query" value="
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- drop <@server@#xsdmodel> ;
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- alias <http://mulgara.org/mulgara#> as exp ;
- "/>
+ <set name="query" value="alias <http://mulgara.org/mulgara#> as exp ;"/>
<eval stepClass="org.mulgara.store.jxunit.QueryJX" />
<ifEqual converse="true" file="result1.txt" name="queryResult">
@@ -58,7 +53,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#is> '2003'^^<http://www.w3.org/2001/XMLSchema#gYear> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#is> '2003'^^<http://www.w3.org/2001/XMLSchema#gYear> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -74,7 +69,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#before> '2002'^^<http://www.w3.org/2001/XMLSchema#gYear> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#before> '2002'^^<http://www.w3.org/2001/XMLSchema#gYear> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -90,7 +85,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#after> '2000'^^<http://www.w3.org/2001/XMLSchema#gYear> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#after> '2000'^^<http://www.w3.org/2001/XMLSchema#gYear> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -134,7 +129,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#is> '--05'^^<http://www.w3.org/2001/XMLSchema#gMonth> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#is> '--05'^^<http://www.w3.org/2001/XMLSchema#gMonth> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -150,7 +145,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#before> '--05'^^<http://www.w3.org/2001/XMLSchema#gMonth> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#before> '--05'^^<http://www.w3.org/2001/XMLSchema#gMonth> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -166,7 +161,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#after> '--09'^^<http://www.w3.org/2001/XMLSchema#gMonth> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#after> '--09'^^<http://www.w3.org/2001/XMLSchema#gMonth> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -228,7 +223,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#is> '---03'^^<http://www.w3.org/2001/XMLSchema#gDay> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#is> '---03'^^<http://www.w3.org/2001/XMLSchema#gDay> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -244,7 +239,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#before> '---04'^^<http://www.w3.org/2001/XMLSchema#gDay> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#before> '---04'^^<http://www.w3.org/2001/XMLSchema#gDay> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -260,7 +255,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#after> '---03'^^<http://www.w3.org/2001/XMLSchema#gDay> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#after> '---03'^^<http://www.w3.org/2001/XMLSchema#gDay> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -304,7 +299,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#is> '2004-03'^^<http://www.w3.org/2001/XMLSchema#gYearMonth> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#is> '2004-03'^^<http://www.w3.org/2001/XMLSchema#gYearMonth> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -320,7 +315,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#before> '2004-03'^^<http://www.w3.org/2001/XMLSchema#gYearMonth> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#before> '2004-03'^^<http://www.w3.org/2001/XMLSchema#gYearMonth> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -336,7 +331,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#after> '2004-01'^^<http://www.w3.org/2001/XMLSchema#gYearMonth> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#after> '2004-01'^^<http://www.w3.org/2001/XMLSchema#gYearMonth> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -397,7 +392,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#is> '--01-03'^^<http://www.w3.org/2001/XMLSchema#gMonthDay> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#is> '--01-03'^^<http://www.w3.org/2001/XMLSchema#gMonthDay> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -413,7 +408,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#before> '--01-04'^^<http://www.w3.org/2001/XMLSchema#gMonthDay> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#before> '--01-04'^^<http://www.w3.org/2001/XMLSchema#gMonthDay> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -429,7 +424,7 @@
select $label
from <@server@#dates>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#after> '--01-04'^^<http://www.w3.org/2001/XMLSchema#gMonthDay> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#after> '--01-04'^^<http://www.w3.org/2001/XMLSchema#gMonthDay> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
Modified: trunk/jxdata/iTQL/data_types/result1.txt
===================================================================
--- trunk/jxdata/iTQL/data_types/result1.txt 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/result1.txt 2008-05-16 22:35:47 UTC (rev 951)
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="UTF-8"?>
-<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully dropped graph @server@#xsdmodel</message></query><query><message>Successfully created graph @server@#xsdmodel</message></query><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
+<answer xmlns="http://mulgara.org/tql#"><query><message>Successfully aliased http://mulgara.org/mulgara# as exp</message></query></answer>
Modified: trunk/jxdata/iTQL/data_types/test.jxu
===================================================================
--- trunk/jxdata/iTQL/data_types/test.jxu 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/jxdata/iTQL/data_types/test.jxu 2008-05-16 22:35:47 UTC (rev 951)
@@ -2,13 +2,8 @@
<set name="debug" value="false" />
- <!-- Configure the data type model -->
- <set name="query" value="
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- drop <@server@#xsdmodel> ;
- create <@server@#xsdmodel> <http://mulgara.org/mulgara#XMLSchemaModel> ;
- alias <http://mulgara.org/mulgara#> as exp ;
- "/>
+ <!-- set up the Mulgara alias -->
+ <set name="query" value="alias <http://mulgara.org/mulgara#> as exp ;"/>
<eval stepClass="org.mulgara.store.jxunit.QueryJX" />
<ifEqual converse="true" file="result1.txt" name="queryResult">
@@ -78,7 +73,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#is> '40'^^<http://www.w3.org/2001/XMLSchema#double> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#is> '40'^^<http://www.w3.org/2001/XMLSchema#double> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -95,7 +90,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#lt> '4.0'^^<http://www.w3.org/2001/XMLSchema#double> in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#lt> '4.0'^^<http://www.w3.org/2001/XMLSchema#double> in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -112,7 +107,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#gt> '38.0' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#gt> '38.0' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -128,7 +123,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#lt> '1.0' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#lt> '1.0' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -144,7 +139,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#gt> '41.0' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#gt> '41.0' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -160,7 +155,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#gt> '0' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#gt> '0' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -176,7 +171,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#lt> '42' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#lt> '42' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -193,7 +188,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#lt> '1.5' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#lt> '1.5' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -210,7 +205,7 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#gt> '-1' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#gt> '-1' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -227,8 +222,8 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#gt> '1' in <@server@#xsdmodel> and
- $value2 <http://mulgara.org/mulgara#lt> '10' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#gt> '1' in <sys:xsd> and
+ $value2 <http://mulgara.org/mulgara#lt> '10' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -244,8 +239,8 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#gt> '10' in <@server@#xsdmodel> and
- $value2 <http://mulgara.org/mulgara#lt> '1' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#gt> '10' in <sys:xsd> and
+ $value2 <http://mulgara.org/mulgara#lt> '1' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
@@ -294,8 +289,8 @@
select $label
from <@server@#numbers>
where $value <http://www.w3.org/2002/07/owl#sameIndividualAs> $value2 and
- $value2 <http://mulgara.org/mulgara#gt> '30.0' in <@server@#xsdmodel> and
- $value2 <http://mulgara.org/mulgara#lt> '40.0' in <@server@#xsdmodel> and
+ $value2 <http://mulgara.org/mulgara#gt> '30.0' in <sys:xsd> and
+ $value2 <http://mulgara.org/mulgara#lt> '40.0' in <sys:xsd> and
$value <http://www.w3.org/2000/01/rdf-schema#label> $label
order by $label ;
"/>
Modified: trunk/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java
===================================================================
--- trunk/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/src/jar/query/java/org/mulgara/query/rdf/Mulgara.java 2008-05-16 22:35:47 UTC (rev 951)
@@ -51,4 +51,7 @@
/** An identifier for a nodetype graph */
public final static String NODE_TYPE_GRAPH = "sys:type";
+
+ /** An identifier for a XSD resolver graph */
+ public final static String XSD_GRAPH = "sys:xsd";
}
Modified: trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java
===================================================================
--- trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolver.java 2008-05-16 22:35:47 UTC (rev 951)
@@ -36,8 +36,6 @@
// Third party packages
import org.apache.log4j.Logger;
-import org.jrdf.graph.Literal;
-import org.jrdf.graph.Node;
import javax.transaction.xa.XAResource;
// Locally written packages
@@ -102,7 +100,7 @@
static long MULGARA_IS;
/** Description of the Field */
- static final Map oppositePropertyMap = new HashMap();
+ static final Map<LocalNode,LocalNode> oppositePropertyMap = new HashMap<LocalNode,LocalNode>();
/** The session that this resolver is associated with */
private final ResolverSession resolverSession;
@@ -220,9 +218,9 @@
if (!(constraint.getElement(0) instanceof Variable) &&
oppositePropertyMap.keySet().contains(constraint.getElement(1)) &&
constraint.getElement(2) instanceof Variable) {
+
constraint = new ConstraintImpl(constraint.getElement(2),
- (LocalNode) oppositePropertyMap.get(
- constraint.getElement(1)),
+ oppositePropertyMap.get(constraint.getElement(1)),
constraint.getElement(0),
constraint.getModel());
}
@@ -232,11 +230,8 @@
if ((constraint.getElement(0) instanceof Variable) &&
!(constraint.getElement(2) instanceof Variable)) {
if (property == MULGARA_LT) {
-
if (logger.isDebugEnabled()) {
- logger.debug("Evaluating " + constraint.getElement(0) +
- " less than " +
- constraint.getElement(2));
+ logger.debug("Evaluating " + constraint.getElement(0) + " less than " + constraint.getElement(2));
}
// Evaluate "less than" for xsd:double
@@ -261,11 +256,8 @@
true // include high value
);
} else if (property == MULGARA_BEFORE) {
-
if (logger.isDebugEnabled()) {
- logger.debug("Evaluating " + constraint.getElement(0) +
- " before " +
- constraint.getElement(2));
+ logger.debug("Evaluating " + constraint.getElement(0) + " before " + constraint.getElement(2));
}
@@ -277,12 +269,9 @@
false // exclude high value
);
} else if (property == MULGARA_AFTER) {
-
// Evaluate "less than" for xsd:double
if (logger.isDebugEnabled()) {
- logger.debug("Evaluating " + constraint.getElement(0) +
- " after " +
- constraint.getElement(2));
+ logger.debug("Evaluating " + constraint.getElement(0) + " after " + constraint.getElement(2));
}
// Evaluate "after" for xsd:date
@@ -298,7 +287,6 @@
assert gNodeTuples != null;
if (logger.isDebugEnabled()) {
-
logger.debug("-- Renaming tuples of type: " + gNodeTuples.getClass());
}
@@ -306,15 +294,9 @@
gNodeTuples.renameVariables(constraint);
if (logger.isDebugEnabled()) {
-
logger.debug("Finished renaming.");
- }
-
-
- if (logger.isDebugEnabled()) {
logger.debug("Evaluated " + constraint.getElement(0) +
- " less than " + constraint.getElement(2) + ": " +
- gNodeTuples);
+ " less than " + constraint.getElement(2) + ": " + gNodeTuples);
}
return new XSDResolution(constraint, gNodeTuples);
@@ -344,13 +326,11 @@
throw new QueryException("Invalid property: " + constraint);
}
- return condition ?
- new XSDResolution(constraint, TuplesOperations.unconstrained()) :
- new XSDResolution(constraint, TuplesOperations.empty());
+ return condition ? new XSDResolution(constraint, TuplesOperations.unconstrained())
+ : new XSDResolution(constraint, TuplesOperations.empty());
} else if (constraint.getElement(0) instanceof Variable &&
constraint.getElement(2) instanceof Variable) {
- throw new QueryException("Can't resolve constraint with 2 variables: " +
- constraint);
+ throw new QueryException("Can't resolve constraint with 2 variables: " + constraint);
} else {
throw new Error("Don't know how to handle constraint: " + constraint);
}
@@ -372,39 +352,25 @@
* @throws QueryException EXCEPTION TO DO
* @throws StringPoolException EXCEPTION TO DO
*/
- private SPObject getBoundDate(ConstraintElement constraintElement) throws
- ParseException, QueryException,
- StringPoolException {
+ private SPObject getBoundDate(ConstraintElement constraintElement)
+ throws ParseException, QueryException, StringPoolException {
if (constraintElement instanceof LocalNode) {
-
- SPObject spo = resolverSession.findStringPoolObject(
- ((LocalNode) constraintElement).getValue());
-
- if (PERMISSIVE_PARAMETER_KLUDGE &&
- spo.getTypeCategory() == TypeCategory.UNTYPED_LITERAL) {
-
+ SPObject spo = resolverSession.findStringPoolObject(((LocalNode)constraintElement).getValue());
+ if (PERMISSIVE_PARAMETER_KLUDGE && spo.getTypeCategory() == TypeCategory.UNTYPED_LITERAL) {
// Try to parse the string as a date or a dateTime.
try {
-
- return resolverSession.getSPObjectFactory().newSPTypedLiteral(
- spo.getLexicalForm(), XSD.DATE_URI);
+ return resolverSession.getSPObjectFactory().newSPTypedLiteral(spo.getLexicalForm(), XSD.DATE_URI);
} catch (IllegalArgumentException e) {
-
try {
-
- return resolverSession.getSPObjectFactory().newSPTypedLiteral(
- spo.getLexicalForm(), XSD.DATE_TIME_URI);
+ return resolverSession.getSPObjectFactory().newSPTypedLiteral(spo.getLexicalForm(), XSD.DATE_TIME_URI);
} catch (IllegalArgumentException e2) {
-
// fall through and let the string be returned unchanged.
}
}
}
-
return spo;
} else {
-
throw new Error("Unsupported constraint element: " + constraintElement);
}
}
@@ -417,38 +383,25 @@
* @throws QueryException EXCEPTION TO DO
* @throws StringPoolException EXCEPTION TO DO
*/
- private SPObject getBoundDouble(ConstraintElement constraintElement) throws
- QueryException, StringPoolException {
-
+ private SPObject getBoundDouble(ConstraintElement constraintElement) throws QueryException, StringPoolException {
if (constraintElement instanceof LocalNode) {
-
- SPObject spo = resolverSession.findStringPoolObject(
- ((LocalNode) constraintElement).getValue());
-
+ SPObject spo = resolverSession.findStringPoolObject(((LocalNode) constraintElement).getValue());
if (logger.isDebugEnabled()) {
-
- logger.debug("!! Local node constraint element: " +
- ((LocalNode) constraintElement).getValue());
+ logger.debug("!! Local node constraint element: " + ((LocalNode) constraintElement).getValue());
logger.debug("!! SPObject returned: " + spo);
}
- if (PERMISSIVE_PARAMETER_KLUDGE &&
- spo.getTypeCategory() == TypeCategory.UNTYPED_LITERAL) {
-
+ if (PERMISSIVE_PARAMETER_KLUDGE && spo.getTypeCategory() == TypeCategory.UNTYPED_LITERAL) {
// Try to parse the string as a Double.
try {
-
- return resolverSession.getSPObjectFactory().newSPTypedLiteral(
- spo.getLexicalForm(), XSD.DOUBLE_URI);
+ return resolverSession.getSPObjectFactory().newSPTypedLiteral(spo.getLexicalForm(), XSD.DOUBLE_URI);
} catch (NumberFormatException e) {
-
// fall through and let the string be returned unchanged.
}
}
return spo;
} else {
-
throw new Error("Unsupported constraint element: " + constraintElement);
}
}
Modified: trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolverFactory.java
===================================================================
--- trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolverFactory.java 2008-05-16 06:08:11 UTC (rev 950)
+++ trunk/src/jar/resolver-xsd/java/org/mulgara/resolver/xsd/XSDResolverFactory.java 2008-05-16 22:35:47 UTC (rev 951)
@@ -59,45 +59,28 @@
*
* @author <a href="http://staff.pisoftware.com/raboczi">Simon Raboczi</a>
* @author Mark Ludlow
- *
- * @version $Revision: 1.14 $
- *
- * @modified $Date: 2005/06/10 07:57:38 $ by $Author: amuys $
- *
* @company <a href="mailto:info at PIsoftware.com">Plugged In Software</a>
- *
- * @copyright © 2004 <a href="http://www.PIsoftware.com/">Plugged In
- * Software Pty Ltd</a>
- *
+ * @copyright © 2004 <a href="http://www.PIsoftware.com/">Plugged In Software Pty Ltd</a>
* @licence <a href="{@docRoot}/../../LICENCE">Mozilla Public License v1.1</a>
*/
public class XSDResolverFactory implements ResolverFactory {
- /**
- * Logger.
- */
- private static Logger logger =
- Logger.getLogger(XSDResolverFactory.class.getName());
+ /** Logger. */
+ @SuppressWarnings("unused")
+ private static Logger logger = Logger.getLogger(XSDResolverFactory.class.getName());
- private static final URI modelTypeURI;
- static {
- try {
- modelTypeURI = new URI(Mulgara.NAMESPACE + "XMLSchemaModel");
- assert modelTypeURI != null;
- } catch (URISyntaxException e) {
- throw new Error("Bad hardcoded XSD model URI", e);
- }
- }
+ /** The URI for the default graph. */
+ private static final URI DEFAULT_GRAPH = URI.create(Mulgara.XSD_GRAPH);
+ private static final URI graphTypeURI = URI.create(Mulgara.NAMESPACE + "XMLSchemaModel");
+
/** The preallocated local node representing the system model */
private long systemModel;
- /**
- * The preallocated local node representing the <code>rdf:type</code>
- * property.
- */
+ /** The preallocated local node representing the <code>rdf:type</code> property. */
private long rdfType;
/** The preallocated local node representing models stored on the Java heap. */
+ @SuppressWarnings("unused")
private long modelType;
/**
@@ -107,80 +90,63 @@
* @throws IllegalArgumentException {@inheritDoc}
* @throws ResolverException {@inheritDoc}
*/
- private XSDResolverFactory(ResolverFactoryInitializer
- resolverFactoryInitializer) throws
- ResolverException, InitializerException {
+ private XSDResolverFactory(ResolverFactoryInitializer resolverFactoryInitializer)
+ throws ResolverException, InitializerException {
// Validate "resolverFactoryInitializer" parameter
if (resolverFactoryInitializer == null) {
-
- throw new IllegalArgumentException(
- "Null \"resolverInitializer\" parameter");
+ throw new IllegalArgumentException("Null \"resolverInitializer\" parameter");
}
// Initialize fields
- rdfType = resolverFactoryInitializer.preallocate(
- new URIReferenceImpl(RDF.TYPE));
-
- modelType = resolverFactoryInitializer.preallocate(
- new URIReferenceImpl(modelTypeURI));
-
+ rdfType = resolverFactoryInitializer.preallocate(new URIReferenceImpl(RDF.TYPE));
+ modelType = resolverFactoryInitializer.preallocate(new URIReferenceImpl(graphTypeURI));
systemModel = resolverFactoryInitializer.getSystemModel();
- // Claim mulgara:MemoryModel
- resolverFactoryInitializer.addModelType(modelTypeURI, this);
+ // No need to Claim mulgara:MemoryModel, as this is done by the default graphs
+ // resolverFactoryInitializer.addModelType(graphTypeURI, this);
try {
-
// Create the after node ID
XSDResolver.MULGARA_AFTER = resolverFactoryInitializer.preallocate(
- new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "after")));
+ new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "after")));
// Create the before node ID
XSDResolver.MULGARA_BEFORE = resolverFactoryInitializer.preallocate(
- new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "before")));
+ new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "before")));
// Create the less than node ID
XSDResolver.MULGARA_LT = resolverFactoryInitializer.preallocate(
- new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "lt")));
+ new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "lt")));
// Create the greater than node ID
XSDResolver.MULGARA_GT = resolverFactoryInitializer.preallocate(
- new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "gt")));
- } catch (URISyntaxException e) {
+ new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "gt")));
+ } catch (URISyntaxException e) {
throw new ResolverException("Generated bad XML schema URI", e);
} catch (InitializerException initializerException) {
-
- throw new ResolverException("Failed to preallocate xsd node values.",
- initializerException);
+ throw new ResolverException("Failed to preallocate xsd node values.", initializerException);
}
// Register XSD-specific constraint types
try {
- resolverFactoryInitializer.registerNewConstraint(
- new IntervalConstraintDescriptor()
- );
+ resolverFactoryInitializer.registerNewConstraint(new IntervalConstraintDescriptor());
} catch (InitializerException initializerException) {
- throw new ResolverException("Failed to register new constraint",
- initializerException);
+ throw new ResolverException("Failed to register new constraint", initializerException);
}
// Register the rule that generates XSD-specific constraints
try {
resolverFactoryInitializer.addSymbolicTransformation(
- new IntervalTransformation(modelTypeURI,
+ new IntervalTransformation(graphTypeURI,
new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "lt")),
new URIReferenceImpl(new URI(Mulgara.NAMESPACE + "gt"))
)
);
- }
- catch (InitializerException initializerException) {
-
- throw new ResolverException("Failed to register new transformation",
- initializerException);
- }
- catch (URISyntaxException e) {
+ } catch (InitializerException initializerException) {
+ throw new ResolverException("Failed to register new transformation", initializerException);
+ } catch (URISyntaxException e) {
throw new Error("Bad hardcoded constant", e);
}
@@ -223,22 +189,21 @@
/**
* {@inheritDoc}
- * @return <code>null</code> - no default graphs for this resolver
+ * @return {sys:xsd, mulgara:XMLSchemaModel}
*/
- public Graph[] getDefaultGraphs() { return null; }
+ public Graph[] getDefaultGraphs() {
+ return new Graph[] { new Graph(DEFAULT_GRAPH, graphTypeURI) };
+ }
/**
* Register this resolver upon database startup.
*
* @param resolverFactoryInitializer the database within which to find or
* create the various XML Schema resources
- * @throws ResolverException If the XML Schema resources can't be found or
- * created
+ * @throws ResolverException If the XML Schema resources can't be found or created
*/
- public static ResolverFactory newInstance(
- ResolverFactoryInitializer resolverFactoryInitializer) throws
- ResolverException, InitializerException {
-
+ public static ResolverFactory newInstance(ResolverFactoryInitializer resolverFactoryInitializer)
+ throws ResolverException, InitializerException {
return new XSDResolverFactory(resolverFactoryInitializer);
}
@@ -252,8 +217,7 @@
public Resolver newResolver(boolean canWrite,
ResolverSession resolverSession,
Resolver systemResolver) throws
- ResolverFactoryException{
-
+ ResolverFactoryException {
return new XSDResolver(resolverSession, systemResolver, rdfType, systemModel);
}
}
More information about the Mulgara-svn
mailing list