diff --git a/Friedrich-Nietzsche-late-work-ontology.ttl b/Friedrich-Nietzsche-late-work-ontology.ttl index 41dad6e..aea1a2b 100644 --- a/Friedrich-Nietzsche-late-work-ontology.ttl +++ b/Friedrich-Nietzsche-late-work-ontology.ttl @@ -1,24 +1,23 @@ @prefix rdfs: . @prefix owl: . @prefix xsd: . @prefix skos: . @prefix dct: . @prefix text: . @prefix textedit: . @prefix scholarly-editing: . @prefix tln: . a owl:Ontology; dct:license ; dct:title "An ontology about the collected late works of Friedrich Nietzsche"@en; dct:description """Formal description of specific concepts in the scientific study of Friedrich Nietzsches late work."""@en; dct:creator "Dominique Steinbach, tool coordinator/software developer, NIE-INE/digital edition of der späte Nietzsche, Basel University, Switzerland"@en; dct:contributor "Christian Steiner, software developer, digital edition of der späte Nietzsche, University of Basel, Switzerland"@en; - dct:publisher "Basel University, Switzerland"@en. + dct:publisher "Basel University, Switzerland"@en. # -# CLASSES +# CLASSES # - diff --git a/machineReasoning_extendUnityWithHomotypicPart/extend-rules.n3 b/machineReasoning_extendUnityWithHomotypicPart/extend-rules.n3 index 1636be4..bd6916e 100755 --- a/machineReasoning_extendUnityWithHomotypicPart/extend-rules.n3 +++ b/machineReasoning_extendUnityWithHomotypicPart/extend-rules.n3 @@ -1,27 +1,27 @@ @prefix owl: . @prefix rdf: . @prefix rdfs: . @prefix xsd: . @prefix log: . @prefix list: . @prefix math: . @prefix e: . @prefix dct: . -@prefix test: . +@prefix homotypic: . ## Extend a ?unity that has homotypic parts # (i.e. a rdf:List that consists of members that are of the same owl:Class as ?unity) # with those properties of its parts # for which ?unity has a owl:minCardinality of 1, if ?unity lacks such a property. ## { ?unity a [owl:onProperty ?property; owl:minCardinality "1"^^xsd:nonNegativeInteger]; a ?class; - test:hasHomotypicParts ?list . + homotypic:hasHomotypicParts ?list . ?SCOPE e:findall (?o {?unity ?property ?o} ()). # empty list ## FROM: raw.githubusercontent.com/nie-ine/N3-rule-based_machine-reasoning/master/machineReasoning_cardinality/machineReasoning_cardinality_input/cardinality-rules.n3 ?part list:in ?list; a ?class; ?property ?object . } => { ?unity ?property ?object . }. diff --git a/machineReasoning_extendUnityWithHomotypicPart/homotypic-part_ontology.ttl b/machineReasoning_extendUnityWithHomotypicPart/homotypic-part_ontology.ttl new file mode 100644 index 0000000..7578c47 --- /dev/null +++ b/machineReasoning_extendUnityWithHomotypicPart/homotypic-part_ontology.ttl @@ -0,0 +1,19 @@ +@prefix dct: . +@prefix owl: . +@prefix rdf: . +@prefix rdfs: . + +@prefix homotypic: . + + + a owl:Ontology; + dct:license ; + dct:title "A stub ontology about homotypic parts"@en; + dct:description """A stub ontology about homotypic parts, i.e. parts that are of the same type as their unities."""@en; + dct:creator "Christian Steiner, software developer, digital edition of der späte Nietzsche, University of Basel, Switzerland"@en; + dct:publisher "Basel University, Switzerland"@en. + +homotypic:hasHomotypicParts a owl:TransitiveProperty; + rdfs:isDefinedBy ; + rdfs:range rdf:List . + diff --git a/machineReasoning_extendUnityWithHomotypicPart/output.n3 b/machineReasoning_extendUnityWithHomotypicPart/output.n3 index 241d667..54ce306 100644 --- a/machineReasoning_extendUnityWithHomotypicPart/output.n3 +++ b/machineReasoning_extendUnityWithHomotypicPart/output.n3 @@ -1,125 +1,131 @@ -# Execution date Di Nov 26 09:09:08 CET 2019 +# Execution date Di Nov 26 10:45:40 CET 2019 #Processed by Id: cwm.py,v 1.197 2007/12/13 15:38:39 syosi Exp # using base file:///data/home/knister0/githubs/nietzscheOntologie/machineReasoning_extendUnityWithHomotypicPart/ # Notation3 generation by # notation3.py,v 1.200 2007/12/11 21:18:08 syosi Exp # Base was: file:///data/home/knister0/githubs/nietzscheOntologie/machineReasoning_extendUnityWithHomotypicPart/ @prefix : . @prefix data: . + @prefix homotypic: . @prefix owl: . @prefix rdf: . @prefix rdfs: . @prefix xsd: . @forSome <#_g0>, <#_g1> . data:_Line0 a :Line . data:_Line1 a :Line . data:_Position0 a :Position; :hasLeft "0.0"^^xsd:float . data:_Position1 a :Position; :hasLeft "0.1"^^xsd:float . data:_Position2 a :Position; :hasLeft "1.0"^^xsd:float . data:_Word0 a :Word, <#_g0>, <#_g1>; - :hasHomotypicParts ( + homotypic:hasHomotypicParts ( data:_Word1 ); :hasLine data:_Line0, data:_Line1; :hasPosition data:_Position0, data:_Position1, data:_Position2; :wordHasWordParts ( data:_Word1 ) . data:_Word1 a :Word, <#_g0>, <#_g1>; - :hasHomotypicParts ( + homotypic:hasHomotypicParts ( data:_Word2 data:_Word3 data:_Word4 ); :hasLine data:_Line0, data:_Line1; :hasPosition data:_Position0, data:_Position1, data:_Position2; :wordHasWordParts ( data:_Word2 data:_Word3 data:_Word4 ) . data:_Word2 a :Word, <#_g0>, <#_g1>; :hasLine data:_Line0; :hasPosition data:_Position0 . data:_Word3 a :Word, <#_g0>, <#_g1>; :hasLine data:_Line0; :hasPosition data:_Position1 . data:_Word4 a :Word, <#_g0>, <#_g1>; :hasLine data:_Line1; :hasPosition data:_Position2 . + a owl:Ontology; + "Christian Steiner, software developer, digital edition of der späte Nietzsche, University of Basel, Switzerland"@en; + "A stub ontology about homotypic parts, i.e. parts that are of the same type as their unities."@en; + ; + "Basel University, Switzerland"@en; + "A stub ontology about homotypic parts"@en . + + homotypic:hasHomotypicParts a owl:TransitiveProperty; + rdfs:isDefinedBy ; + rdfs:range rdf:List . + :Line a owl:Class . :Position a owl:Class . :Word a owl:Class; rdfs:subClassOf <#_g0>, <#_g1> . - :hasHomotypicParts a owl:TransitiveProperty; - rdfs:domain :Word, - <#_g0>, - <#_g1>; - rdfs:range rdf:List . - :hasLeft a owl:DatatypeProperty; rdfs:domain :Position; rdfs:range xsd:float . :hasLine a owl:ObjectProperty; rdfs:domain :Word, <#_g0>, <#_g1>; rdfs:range :Line . :hasPosition a owl:ObjectProperty; rdfs:domain :Word, <#_g0>, <#_g1>; rdfs:range :Position . :wordHasWordParts a owl:Property; rdfs:domain :Word, <#_g0>, <#_g1>; rdfs:range rdf:List; - rdfs:subPropertyOf :hasHomotypicParts . + rdfs:subPropertyOf homotypic:hasHomotypicParts . <#_g0> a owl:Restriction; owl:minCardinality "1"^^xsd:nonNegativeInteger; owl:onProperty :hasPosition . <#_g1> a owl:Restriction; owl:minCardinality "1"^^xsd:nonNegativeInteger; owl:onProperty :hasLine . #ENDS diff --git a/machineReasoning_extendUnityWithHomotypicPart/reasoning_extendUnityWithHomotypicPart.sh b/machineReasoning_extendUnityWithHomotypicPart/reasoning_extendUnityWithHomotypicPart.sh index b8cb6a1..6c8fe7f 100755 --- a/machineReasoning_extendUnityWithHomotypicPart/reasoning_extendUnityWithHomotypicPart.sh +++ b/machineReasoning_extendUnityWithHomotypicPart/reasoning_extendUnityWithHomotypicPart.sh @@ -1,47 +1,47 @@ #!/bin/bash #start:special option edit {{{1 ##--edit: special option edit if [[ `echo $@ | grep '[-][-]edit'` != "" ]];then if [[ -e ~/bin/bin.vim ]];then vi -s ~/bin/bin.vim $0 else edit $0 fi exit $? fi #end:special option edit 1}}} function usage () { #{{{1 echo "Usage: `basename $0` [OPTIONS] ontology-file.ttl data-file.ttl" grep '^##[-]' $0 exit $1 } ##--help,-h: show help if [[ `echo $@ | grep '\(^[-]h$\|[-][-]help\)'` != "" ]];then usage 0 fi #1}}} function runEye () { #{{{1 echo "# Execution date" $(date) > $output - eye.sh --nope --traditional $myontology $mydata https://raw.githubusercontent.com/josd/eye/master/reasoning/rpo/rdfs-subClassOf.n3 https://raw.githubusercontent.com/josd/eye/master/reasoning/rpo/rdfs-subPropertyOf.n3 https://raw.githubusercontent.com/josd/eye/master/reasoning/rpo/owl-TransitiveProperty.n3 extend-rules.n3 --query query.n3 + eye.sh --nope --traditional homotypic-part_ontology.ttl $myontology $mydata https://raw.githubusercontent.com/josd/eye/master/reasoning/rpo/rdfs-subClassOf.n3 https://raw.githubusercontent.com/josd/eye/master/reasoning/rpo/rdfs-subPropertyOf.n3 https://raw.githubusercontent.com/josd/eye/master/reasoning/rpo/owl-TransitiveProperty.n3 extend-rules.n3 --query query.n3 } #1}}} output="output.n3" input=$(echo $@ | sed -e 's/[-][-]DATA\s*//') myontology=$(echo $input | awk '{ print $1 }') mydata=$(echo $input | awk '{ print $2 }') if [[ -z "$myontology" || ! -e $myontology ]];then myontology=$(ls -c *ontology*.ttl | head -1) fi if [[ -z "$mydata" || ! -e $mydata ]];then mydata=$(ls -c | grep -i '.*data.*\.ttl' | head -1) fi if [[ -z "$myontology" || -z "$mydata" ]];then usage 2 fi ##--DATA: output a ttl-file, default n3 if [[ -n $(echo $@ | grep '[-][-]DATA') ]];then output="output.ttl" runEye >> $output else runEye |cwm >> $output fi diff --git a/machineReasoning_extendUnityWithHomotypicPart/test-ontology.ttl b/machineReasoning_extendUnityWithHomotypicPart/test-ontology.ttl index 77d2fca..50e0fbd 100644 --- a/machineReasoning_extendUnityWithHomotypicPart/test-ontology.ttl +++ b/machineReasoning_extendUnityWithHomotypicPart/test-ontology.ttl @@ -1,40 +1,37 @@ @prefix rdfs: . @prefix owl: . @prefix xsd: . @prefix rdf: . +@prefix homotypic: . @prefix test: . test:Word a owl:Class ; rdfs:subClassOf [ a owl:Restriction ; owl:minCardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty test:hasPosition ] , [ a owl:Restriction ; owl:minCardinality "1"^^xsd:nonNegativeInteger ; owl:onProperty test:hasLine ] . -test:hasHomotypicParts a owl:TransitiveProperty; - rdfs:domain test:Word ; - rdfs:range rdf:List . - test:wordHasWordParts a owl:Property; - rdfs:subPropertyOf test:hasHomotypicParts; + rdfs:subPropertyOf homotypic:hasHomotypicParts; rdfs:domain test:Word; rdfs:range rdf:List . test:hasPosition a owl:ObjectProperty ; rdfs:domain test:Word ; rdfs:range test:Position . test:Position a owl:Class . test:hasLeft a owl:DatatypeProperty; rdfs:domain test:Position; rdfs:range xsd:float . test:hasLine a owl:ObjectProperty ; rdfs:domain test:Word ; rdfs:range test:Line . test:Line a owl:Class .