diff options
Diffstat (limited to 'test/graph/test_graph.py')
-rw-r--r-- | test/graph/test_graph.py | 52 |
1 files changed, 29 insertions, 23 deletions
diff --git a/test/graph/test_graph.py b/test/graph/test_graph.py index e6d5ae4..167168d 100644 --- a/test/graph/test_graph.py +++ b/test/graph/test_graph.py @@ -19,12 +19,14 @@ from bsfs.graph.graph import Graph ## code ## +ns.bse = ns.bsfs.Entity() + class TestGraph(unittest.TestCase): def setUp(self): self.backend = SparqlStore.Open() self.backend.schema = schema.from_string(''' prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> - prefix bsfs: <http://bsfs.ai/schema/> + prefix bsfs: <https://schema.bsfs.io/core/> bsfs:Entity rdfs:subClassOf bsfs:Node . ''') self.user = URI('http://example.com/me') @@ -129,12 +131,13 @@ class TestGraph(unittest.TestCase): target_1 = schema.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/> bsfs:Entity rdfs:subClassOf bsfs:Node . xsd:string rdfs:subClassOf bsfs:Literal . - bsfs:Number rdfs:subClassOf bsfs:Literal . - xsd:integer rdfs:subClassOf bsfs:Number . + bsl:Number rdfs:subClassOf bsfs:Literal . + xsd:integer rdfs:subClassOf bsl:Number . bse:filename rdfs:subClassOf bsfs:Predicate ; rdfs:domain bsfs:Entity ; @@ -154,11 +157,12 @@ class TestGraph(unittest.TestCase): self.assertEqual(graph.schema, target_1 + schema.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 bsm: <http://bsfs.ai/schema/Meta#> - bsfs:Number rdfs:subClassOf bsfs:Literal . - xsd:float rdfs:subClassOf bsfs:Number . - bsm:t_created rdfs:subClassOf bsfs:Predicate ; + prefix bsfs: <https://schema.bsfs.io/core/> + prefix bsn: <https://schema.bsfs.io/core/Node#> + prefix bsl: <https://schema.bsfs.io/core/Literal/> + bsl:Number rdfs:subClassOf bsfs:Literal . + xsd:float rdfs:subClassOf bsl:Number . + bsn:t_created rdfs:subClassOf bsfs:Predicate ; rdfs:domain bsfs:Node ; rdfs:range xsd:float ; bsfs:unique "true"^^xsd:boolean . @@ -168,12 +172,13 @@ class TestGraph(unittest.TestCase): target_2 = schema.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: <http://schema.bsfs.io/core/> + prefix bse: <http://schema.bsfs.io/core/Node/Entity#> + prefix bsl: <https://schema.bsfs.io/core/Literal/> bsfs:Entity rdfs:subClassOf bsfs:Node . xsd:string rdfs:subClassOf bsfs:Literal . - bsfs:Number rdfs:subClassOf bsfs:Literal . - xsd:integer rdfs:subClassOf bsfs:Number . + bsl:Number rdfs:subClassOf bsfs:Literal . + xsd:integer rdfs:subClassOf bsl:Number . bse:filename rdfs:subClassOf bsfs:Predicate ; rdfs:domain bsfs:Entity ; @@ -195,11 +200,12 @@ class TestGraph(unittest.TestCase): self.assertEqual(graph.schema, target_2 + schema.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 bsm: <http://bsfs.ai/schema/Meta#> - bsfs:Number rdfs:subClassOf bsfs:Literal . - xsd:float rdfs:subClassOf bsfs:Number . - bsm:t_created rdfs:subClassOf bsfs:Predicate ; + prefix bsfs: <https://schema.bsfs.io/core/> + prefix bsn: <https://schema.bsfs.io/core/Node#> + prefix bsl: <https://schema.bsfs.io/core/Literal/> + bsl:Number rdfs:subClassOf bsfs:Literal . + xsd:float rdfs:subClassOf bsl:Number . + bsn:t_created rdfs:subClassOf bsfs:Predicate ; rdfs:domain bsfs:Node ; rdfs:range xsd:float ; bsfs:unique "true"^^xsd:boolean . @@ -211,8 +217,8 @@ class TestGraph(unittest.TestCase): graph.migrate(schema.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#> bsfs:Entity rdfs:subClassOf bsfs:Node . bsfs:Tag rdfs:subClassOf bsfs:Node . @@ -264,8 +270,8 @@ class TestGraph(unittest.TestCase): graph.migrate(schema.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#> bsfs:Entity rdfs:subClassOf bsfs:Node . bsfs:Tag rdfs:subClassOf bsfs:Node . |