[sparql] adding test for "rdf:type -> is" stable
authorNicolas Chauvat <nicolas.chauvat@logilab.fr>
Sun, 30 May 2010 01:54:12 +0200
branchstable
changeset 5609 d247e2e06db2
parent 5608 f9ab62103ad4
child 5610 91b0f118328a
[sparql] adding test for "rdf:type -> is"
test/unittest_spa2rql.py
xy.py
--- a/test/unittest_spa2rql.py	Sat May 29 10:33:57 2010 +0200
+++ b/test/unittest_spa2rql.py	Sun May 30 01:54:12 2010 +0200
@@ -50,6 +50,14 @@
       ?project a doap:Project;
     }''', 'Any PROJECT WHERE PROJECT is Project')
 
+    def test_base_rdftype(self):
+        self._test('''
+    PREFIX doap: <http://usefulinc.com/ns/doap#>
+    PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+    SELECT ?project
+    WHERE  {
+      ?project rdf:type doap:Project.
+    }''', 'Any PROJECT WHERE PROJECT is Project')
 
     def test_base_attr_sel(self):
         self._test('''
--- a/xy.py	Sat May 29 10:33:57 2010 +0200
+++ b/xy.py	Sun May 30 01:54:12 2010 +0200
@@ -21,6 +21,7 @@
 
 from yams import xy
 
+xy.register_prefix('http://www.w3.org/1999/02/22-rdf-syntax-ns#', 'rdf')
 xy.register_prefix('http://purl.org/dc/elements/1.1/', 'dc')
 xy.register_prefix('http://xmlns.com/foaf/0.1/',       'foaf')
 xy.register_prefix('http://usefulinc.com/ns/doap#',    'doap')