diff options
Diffstat (limited to 'test/triple_store/sparql/test_sparql.py')
-rw-r--r-- | test/triple_store/sparql/test_sparql.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/test/triple_store/sparql/test_sparql.py b/test/triple_store/sparql/test_sparql.py index 1f56a7e..435ca28 100644 --- a/test/triple_store/sparql/test_sparql.py +++ b/test/triple_store/sparql/test_sparql.py @@ -392,6 +392,23 @@ class TestSparqlStore(unittest.TestCase): class Foo(): pass self.assertRaises(TypeError, setattr, store, 'schema', Foo()) + # cannot define features w/o known distance function + invalid = bsc.from_string(''' + prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> + prefix xsd: <http://www.w3.org/2001/XMLSchema#> + prefix bsfs: <http://bsfs.ai/schema/> + prefix bse: <http://bsfs.ai/schema/Entity#> + + bsfs:Array rdfs:subClassOf bsfs:Literal . + bsfs:Feature rdfs:subClassOf bsfs:Array . + + bsfs:Colors rdfs:subClassOf bsfs:Feature ; + bsfs:dimension "4"^^xsd:integer ; + bsfs:distance bsfs:foobar . + + ''') + self.assertRaises(ValueError, setattr, store, 'schema', invalid) + # cannot migrate to incompatible schema invalid = bsc.from_string(''' prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> |