Last active
July 4, 2025 16:17
-
-
Save niklasl/cf8871f82564749153d929f747228ef3 to your computer and use it in GitHub Desktop.
OWL-powered truth generation
This file contains hidden or 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
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix owl: <http://www.w3.org/2002/07/owl#> | |
prefix : <http://example.org/ns#> | |
base <http://example.org/> | |
# TBox: | |
:Truth rdfs:subClassOf [ owl:onProperty rdf:reifies ; owl:allValuesFrom :Fact ] . | |
:Fact owl:equivalentClass [ owl:onProperty _:selfOfTypeFact ; owl:hasSelf true ] , | |
[ owl:onProperty rdf:predicate ; | |
owl:allValuesFrom [ owl:onProperty owl:propertyChainAxiom ; | |
owl:hasValue ( | |
[ owl:inverseOf rdf:subject ] | |
_:selfOfTypeFact | |
rdf:object | |
) ] ] . | |
# ABox: | |
[] a :Truth ; | |
rdf:reifies [ rdf:subject <some> ; rdf:predicate :such ; rdf:object <thing> ] , | |
[ rdf:subject <other> ; rdf:predicate :such ; rdf:object <stuff> ] . | |
# Entails: | |
# <some> :such <thing> . | |
# <other> :such <stuff> . |
This file contains hidden or 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
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> | |
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> | |
prefix owl: <http://www.w3.org/2002/07/owl#> | |
prefix : <http://example.org/ns#> | |
base <http://example.org/> | |
# TBox: | |
:Truth rdfs:subClassOf [ owl:onProperty rdf:reifies ; owl:allValuesFrom :Fact ] . | |
[ owl:onProperty _:a_Fact ; owl:hasSelf true ] owl:equivalentClass :Fact . | |
_:factSubject | |
rdfs:subPropertyOf [ owl:inverseOf rdf:type ] ; | |
owl:propertyChainAxiom ( _:a_Fact rdf:tripleSubject ) . | |
_:factPredicate | |
rdfs:subPropertyOf owl:onProperty ; | |
owl:propertyChainAxiom ( _:a_Fact rdf:triplePredicate ) . | |
_:factObject | |
rdfs:subPropertyOf owl:hasValue ; | |
owl:propertyChainAxiom ( _:a_Fact rdf:tripleObject ) . | |
# ABox: | |
[] a :Truth ; | |
rdf:reifies [ rdf:tripleSubject <some> ; rdf:triplePredicate :such1 ; rdf:tripleObject <thing> ] , | |
[ rdf:tripleSubject <other> ; rdf:triplePredicate :such2 ; rdf:tripleObject <stuff> ] . | |
# Entails: | |
# <some> :such1 <thing> . | |
# <other> :such2 <stuff> . |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Added variant which seems to fare better.