-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
6b386e9
commit a8a67ab
Showing
12 changed files
with
464 additions
and
291 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
from test.unittests.commands.xml_validate.fixtures_data_deserialised import * # noqa: F403 | ||
from test.unittests.commands.xml_validate.fixtures_data_rdf import * # noqa: F403 | ||
from test.unittests.commands.xml_validate.fixtures_onto import * # noqa: F403 | ||
from test.unittests.commands.xml_validate.fixtures_xml_data import * # noqa: F403 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
import pytest | ||
from rdflib import Graph | ||
from rdflib import Namespace | ||
|
||
ONTO = Namespace("http://0.0.0.0:3333/ontology/9999/onto/v2#") | ||
API_SHAPES = Namespace("http://api.knora.org/ontology/knora-api/shapes/v2#") | ||
PREFIXES = """ | ||
@prefix knora-api: <http://api.knora.org/ontology/knora-api/v2#> . | ||
@prefix onto: <http://0.0.0.0:3333/ontology/9999/onto/v2#> . | ||
@prefix owl: <http://www.w3.org/2002/07/owl#> . | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . | ||
@prefix salsah-gui: <http://api.knora.org/ontology/salsah-gui/v2#> . | ||
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> . | ||
""" | ||
|
||
|
||
@pytest.fixture | ||
def link_prop_card_1() -> Graph: | ||
ttl = f"""{PREFIXES} | ||
onto:ClassMixedCard a owl:Class ; | ||
rdfs:label "Resource with all cardinality options" ; | ||
knora-api:canBeInstantiated true ; | ||
knora-api:isResourceClass true ; | ||
rdfs:subClassOf [ | ||
a owl:Restriction ; | ||
salsah-gui:guiOrder 1 ; | ||
owl:cardinality 1 ; | ||
owl:onProperty onto:testHasLinkToCardOneResourceValue | ||
] , | ||
[ a owl:Restriction ; | ||
salsah-gui:guiOrder 1 ; | ||
owl:cardinality 1 ; | ||
owl:onProperty onto:testHasLinkToCardOneResource ] . | ||
onto:testHasLinkToCardOneResource a owl:ObjectProperty ; | ||
rdfs:label "Super-class" ; | ||
knora-api:isEditable true ; | ||
knora-api:isLinkProperty true ; | ||
knora-api:isResourceProperty true ; | ||
knora-api:objectType onto:CardOneResource ; | ||
salsah-gui:guiElement salsah-gui:Searchbox ; | ||
rdfs:subPropertyOf knora-api:hasLinkTo . | ||
onto:testHasLinkToCardOneResourceValue a owl:ObjectProperty ; | ||
rdfs:label "Super-class" ; | ||
knora-api:isEditable true ; | ||
knora-api:isLinkValueProperty true ; | ||
knora-api:isResourceProperty true ; | ||
knora-api:objectType knora-api:LinkValue ; | ||
salsah-gui:guiElement salsah-gui:Searchbox ; | ||
rdfs:subPropertyOf knora-api:hasLinkToValue . | ||
""" | ||
g = Graph() | ||
g.parse(data=ttl, format="ttl") | ||
return g | ||
|
||
|
||
@pytest.fixture | ||
def link_prop_card_01() -> Graph: | ||
ttl = f"""{PREFIXES} | ||
onto:ClassMixedCard a owl:Class ; | ||
rdfs:label "Resource with all cardinality options" ; | ||
knora-api:canBeInstantiated true ; | ||
knora-api:isResourceClass true ; | ||
rdfs:subClassOf [ | ||
a owl:Restriction ; | ||
salsah-gui:guiOrder 1 ; | ||
owl:maxCardinality 1 ; | ||
owl:onProperty onto:testHasLinkToCardOneResourceValue | ||
] , | ||
[ a owl:Restriction ; | ||
salsah-gui:guiOrder 1 ; | ||
owl:maxCardinality 1 ; | ||
owl:onProperty onto:testHasLinkToCardOneResource ] . | ||
onto:testHasLinkToCardOneResource a owl:ObjectProperty ; | ||
rdfs:label "Super-class" ; | ||
knora-api:isEditable true ; | ||
knora-api:isLinkProperty true ; | ||
knora-api:isResourceProperty true ; | ||
knora-api:objectType onto:CardOneResource ; | ||
salsah-gui:guiElement salsah-gui:Searchbox ; | ||
rdfs:subPropertyOf knora-api:hasLinkTo . | ||
onto:testHasLinkToCardOneResourceValue a owl:ObjectProperty ; | ||
rdfs:label "Super-class" ; | ||
knora-api:isEditable true ; | ||
knora-api:isLinkValueProperty true ; | ||
knora-api:isResourceProperty true ; | ||
knora-api:objectType knora-api:LinkValue ; | ||
salsah-gui:guiElement salsah-gui:Searchbox ; | ||
rdfs:subPropertyOf knora-api:hasLinkToValue . | ||
""" | ||
g = Graph() | ||
g.parse(data=ttl, format="ttl") | ||
return g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.