aboutsummaryrefslogtreecommitdiffstats
path: root/test/triple_store/sparql/test_sparql.py
diff options
context:
space:
mode:
authorMatthias Baumgartner <dev@igsor.net>2023-01-15 21:00:12 +0100
committerMatthias Baumgartner <dev@igsor.net>2023-01-15 21:00:12 +0100
commit80a97bfa9f22d0d6dd25928fe1754a3a0d1de78a (patch)
tree30d30fb669d7b43d7324ef8027306c24c1ec1ac2 /test/triple_store/sparql/test_sparql.py
parentccaee71e2b6135d3b324fe551c8652940b67aab3 (diff)
downloadbsfs-80a97bfa9f22d0d6dd25928fe1754a3a0d1de78a.tar.gz
bsfs-80a97bfa9f22d0d6dd25928fe1754a3a0d1de78a.tar.bz2
bsfs-80a97bfa9f22d0d6dd25928fe1754a3a0d1de78a.zip
Distance filter ast node
Diffstat (limited to 'test/triple_store/sparql/test_sparql.py')
-rw-r--r--test/triple_store/sparql/test_sparql.py17
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#>