from rdflib import Namespace, RDF, RDFS, ConjunctiveGraph def statements() : XL = Namespace('http://www.w3.org/2008/05/skos-xl#') SKOS = Namespace('http://www.w3.org/2008/05/skos#') OWL = Namespace('http://www.w3.org/2002/07/owl#') statements = [] # S1 skos:Concept is an instance of owl:Class. S1 = [] # no triples to add statements.append(S1) # S2 skos:ConceptScheme is an instance of owl:Class. S2 = [] # no triples to add statements.append(S2) # S3 skos:inScheme and skos:hasTopConcept are each instances of owl:ObjectProperty. S3 = [] # no triples to add statements.append(S3) # S4 The rdfs:range of skos:inScheme is the class skos:ConceptScheme. S4 = [] # no triples to add statements.append(S4) # S5 The rdfs:domain of skos:hasTopConcept is the class skos:ConceptScheme. S5 = [] # no triples to add statements.append(S5) # S6 The rdfs:range of skos:hasTopConcept is the class skos:Concept. S6 = [] # no triples to add statements.append(S6) # S7 skos:ConceptScheme is disjoint with skos:Concept. S7 = [] # no triples to add statements.append(S7) # S8 skos:prefLabel, skos:altLabel and skos:hiddenLabel are each instances of owl:DatatypeProperty. S8 = [] # no triples to add statements.append(S8) # S9 The rdfs:range of each of skos:prefLabel, skos:altLabel and skos:hiddenLabel is the class of RDF plain literals. S9 = [] # no triples to add statements.append(S9) # S10 skos:prefLabel, skos:altLabel and skos:hiddenLabel are pairwise disjoint properties. S10 = [] # no triples to add statements.append(S10) # S11 A resource has no more than one value of skos:prefLabel per language. S11 = [] # no triples to add statements.append(S11) # S12 skos:notation is an instance of owl:DatatypeProperty. S12 = [] # no triples to add statements.append(S12) # S13 skos:note, skos:changeNote, skos:definition, skos:editorialNote, skos:example, skos:historyNote and skos:scopeNote are each instances of owl:ObjectProperty. S13 = [] # no triples to add statements.append(S13) # S14 skos:changeNote, skos:definition, skos:editorialNote, skos:example, skos:historyNote and skos:scopeNote are each sub-properties of skos:note. S14 = [] # no triples to add statements.append(S14) # S15 skos:semanticRelation, skos:broader, skos:narrower, skos:related, skos:broaderTransitive and skos:narrowerTransitive are each instances of owl:ObjectProperty. S15 = [] # no triples to add statements.append(S15) # S16 The rdfs:domain of skos:semanticRelation is the class skos:Concept. S16 = [] # no triples to add statements.append(S16) # S17 The rdfs:range of skos:semanticRelation is the class skos:Concept. S17 = [] # no triples to add statements.append(S17) # S18 skos:broaderTransitive, skos:narrowerTransitive and skos:related are each sub-properties of skos:semanticRelation. S18 = [] # no triples to add statements.append(S18) # S19 skos:broader is a sub-property of skos:broaderTransitive, and skos:narrower is a sub-property of skos:narrowerTransitive. S19 = [] # no triples to add statements.append(S19) # S20 skos:related is an instance of owl:SymmetricProperty. S20 = [] # no triples to add statements.append(S20) # S21 skos:broader, skos:narrower and skos:related are each not instances of owl:TransitiveProperty. S21 = [] # no triples to add statements.append(S21) # S22 skos:broaderTransitive and skos:narrowerTransitive are each instances of owl:TransitiveProperty. S22 = [] # no triples to add statements.append(S22) # S23 skos:narrower is the owl:inverseOf the property skos:broader. S23 = [] # no triples to add statements.append(S23) # S24 skos:narrowerTransitive is the owl:inverseOf the property skos:broaderTransitive. S24 = [] # no triples to add statements.append(S24) # S25 skos:related is disjoint with the property skos:broaderTransitive. S25 = [] # no triples to add statements.append(S25) # S26 skos:Collection and skos:OrderedCollection are each instances of owl:Class. S26 = [] # no triples to add statements.append(S26) # S27 skos:OrderedCollection is a sub-class of skos:Collection. S27 = [] # no triples to add statements.append(S27) # S28 skos:member and skos:memberList are each instances of owl:ObjectProperty. S28 = [] # no triples to add statements.append(S28) # S29 The rdfs:domain of skos:member is the class skos:Collection. S29 = [] # no triples to add statements.append(S29) # S30 The rdfs:domain of skos:memberList is the class skos:OrderedCollection. S30 = [] # no triples to add statements.append(S30) # S31 The rdfs:range of skos:memberList is the class rdf:List. S31 = [] # no triples to add statements.append(S31) # S32 skos:memberList is an instance of owl:FunctionalProperty. S32 = [] # no triples to add statements.append(S32) # S33 For any resource, every item in the list given as the value of the skos:memberList property is also a value of the skos:member property. S33 = [] # no triples to add statements.append(S33) # S34 skos:Collection is disjoint with each of skos:Concept and skos:ConceptScheme. S34 = [] # no triples to add statements.append(S34) # S35 skos:mappingRelation, skos:exactMatch, skos:broadMatch, skos:narrowMatch and skos:relatedMatch are each instances of owl:ObjectProperty. S35 = [] # no triples to add statements.append(S35) # S36 The rdfs:domain of skos:mappingRelation is the class skos:Concept. S36 = [] # no triples to add statements.append(S36) # S37 The rdfs:range of skos:mappingRelation is the class skos:Concept S37 = [] # no triples to add statements.append(S37) # S38 skos:exactMatch, skos:broadMatch, skos:narrowMatch and skos:relatedMatch are each sub-properties of skos:mappingRelation. S38 = [] # no triples to add statements.append(S38) # S39 skos:broadMatch is a sub-property of skos:broader, skos:narrowMatch is a sub-property of skos:narrower, and skos:relatedMatch is a sub-property of skos:related. S39 = [] # no triples to add statements.append(S39) # S40 skos:narrowMatch is the owl:inverseOf the property skos:broadMatch. S40 = [] # no triples to add statements.append(S40) # S41 skos:relatedMatch is an instance of owl:SymmetricProperty. S41 = [] # no triples to add statements.append(S41) # S42 skos:exactMatch is an instance of owl:SymmetricProperty. S42 = [] # no triples to add statements.append(S42) # S43 xl:Label is an instance of owl:Class. S43 = [] S43.append((XL['Label'], RDF.type, OWL['Class'])) statements.append(S43) # S44 xl:Label is disjoint with each of skos:Concept, skos:ConceptScheme and skos:Collection. S44 = [] S44.append((XL['Label'], OWL['disjointWith'], SKOS['Concept'])) S44.append((XL['Label'], OWL['disjointWith'], SKOS['ConceptScheme'])) S44.append((XL['Label'], OWL['disjointWith'], SKOS['Collection'])) statements.append(S44) # S45 xl:literalForm is an instance of owl:DatatypeProperty. S45 = [] S45.append((XL['literalForm'], RDF.type, OWL['DatatypeProperty'])) statements.append(S45) # S46 The rdfs:domain of xl:literalForm is the class xl:Label. S46 = [] S46.append((XL['literalForm'], RDFS.domain, XL['Label'])) statements.append(S46) # S47 The rdfs:range of xl:literalForm is the class of RDF plain literals. S47 = [] # no triples to add statements.append(S47) # S48 xl:literalForm is an instance of owl:FunctionalProperty. S48 = [] S48.append((XL['literalForm'], RDF.type, OWL['FunctionalProperty'])) statements.append(S48) # S49 xl:prefLabel, xl:altLabel and xl:hiddenLabel are each instances of owl:ObjectProperty. S49 = [] S49.append((XL['prefLabel'], RDF.type, OWL['ObjectProperty'])) S49.append((XL['altLabel'], RDF.type, OWL['ObjectProperty'])) S49.append((XL['hiddenLabel'], RDF.type, OWL['ObjectProperty'])) statements.append(S49) # S50 The rdfs:range of each of xl:prefLabel, xl:altLabel and xl:hiddenLabel is the class xl:Label. S50 = [] S50.append((XL['prefLabel'], RDFS.range, XL['Label'])) S50.append((XL['altLabel'], RDFS.range, XL['Label'])) S50.append((XL['hiddenLabel'], RDFS.range, XL['Label'])) statements.append(S50) # S51 The property chain (xl:prefLabel, xl:literalForm) is a sub-property of skos:prefLabel. S51 = [] # no triples to add statements.append(S51) # S52 The property chain (xl:altLabel, xl:literalForm) is a sub-property of skos:altLabel. S52 = [] # no triples to add statements.append(S52) # S53 The property chain (xl:hiddenLabel, xl:literalForm) is a sub-property of skos:hiddenLabel. S53 = [] # no triples to add statements.append(S53) # S54 xl:labelRelation is an instance of owl:ObjectProperty. S54 = [] S54.append((XL['labelRelation'], RDF.type, OWL['ObjectProperty'])) statements.append(S54) # S55 The rdfs:domain of xl:labelRelation is the class xl:Label. S55 = [] S55.append((XL['labelRelation'], RDFS.domain, XL['Label'])) statements.append(S55) # S56 The rdfs:range of xl:labelRelation is the class xl:Label. S56 = [] S56.append((XL['labelRelation'], RDFS.range, XL['Label'])) statements.append(S56) # S57 xl:labelRelation is an instance of owl:SymmetricProperty. S57 = [] S57.append((XL['labelRelation'], RDF.type, OWL['SymmetricProperty'])) statements.append(S57) return statements def schema() : schema = ConjunctiveGraph() for statement in statements() : for triple in statement : schema.add(triple) return schema # all done