aboutsummaryrefslogtreecommitdiffstats
path: root/test/graph/test_resolve.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/graph/test_resolve.py')
-rw-r--r--test/graph/test_resolve.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/test/graph/test_resolve.py b/test/graph/test_resolve.py
index 0918b02..e09b1cc 100644
--- a/test/graph/test_resolve.py
+++ b/test/graph/test_resolve.py
@@ -1,9 +1,4 @@
-"""
-Part of the bsfs test suite.
-A copy of the license is provided with the project.
-Author: Matthias Baumgartner, 2022
-"""
# imports
import unittest
@@ -21,6 +16,8 @@ from bsfs.graph.resolve import Filter
## code ##
+ns.bse = ns.bsfs.Entity()
+
class TestFilter(unittest.TestCase):
"""
@@ -30,23 +27,25 @@ class TestFilter(unittest.TestCase):
"""
- def test_call(self):
+ def test_call(self): # tests resolve implicitly
schema = 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#>
+ prefix bsfs: <https://schema.bsfs.io/core/>
+ prefix bse: <https://schema.bsfs.io/core/Entity#>
+ prefix bsl: <https://schema.bsfs.io/core/Literal/>
+ prefix bsa: <https://schema.bsfs.io/core/Literal/Array/>
bsfs:Entity rdfs:subClassOf bsfs:Node .
bsfs:Tag rdfs:subClassOf bsfs:Node .
xsd:string rdfs:subClassOf bsfs:Literal .
- bsfs:Number rdfs:subClassOf bsfs:Literal .
- bsfs:Array rdfs:subClassOf bsfs:Literal .
- bsfs:Feature rdfs:subClassOf bsfs:Array .
- xsd:integer rdfs:subClassOf bsfs:Number .
+ bsl:Number rdfs:subClassOf bsfs:Literal .
+ bsl:Array rdfs:subClassOf bsfs:Literal .
+ bsa:Feature rdfs:subClassOf bsl:Array .
+ xsd:integer rdfs:subClassOf bsl:Number .
- bsfs:Colors rdfs:subClassOf bsfs:Feature ;
+ bsfs:Colors rdfs:subClassOf bsa:Feature ;
bsfs:dimension "5"^^xsd:integer .
bse:colors rdfs:subClassOf bsfs:Predicate ;
@@ -79,6 +78,9 @@ class TestFilter(unittest.TestCase):
{'http://example.com/you/invalid#1234', 'http://example.com/you/invalid#4321'})
resolver = Filter(schema)
+ # query can be None
+ self.assertIsNone(resolver(schema.node(ns.bsfs.Entity), None))
+
# immediate Is
self.assertEqual(resolver(schema.node(ns.bsfs.Entity),
ast.filter.Is(ents)),