Predicate Calculus Sketches #26
Replies: 2 comments
-
Referencing this issue on n-ary predicates: w3c/EasierRDF#20 |
Beta Was this translation helpful? Give feedback.
-
Probabilistic LogicWith respect to n-ary predicate calculus, we can also consider the matter of probabilistic logic. Some approaches are indicated. Reifying Truth ValuesFirstly, we could reify expressions' truth values as arguments: example:myPredicate calculus:holdsFor ( true example:x example:y example:z ) . example:myPredicate calculus:holdsFor ( "0.95"^^xsd:double example:x example:y example:z ) . Reifying ExpressionsSecondly, we could reify expressions and describe them with probability scores: example:myPredicate calculus:holdsFor ( example:x example:y example:z ) .
[] rdf:type rdf:Statement ;
rdf:subject example:myPredicate ;
rdf:predicate calculus:holdsFor ;
rdf:object ( example:x example:y example:z ) ;
calculus:probability "0.95"^^xsd:double . Noteworthy is that, by means of OWL restrictions, we can omit much of the redundant information when describing reified expressions. example:myPredicate calculus:holdsFor ( example:x example:y example:z ) .
[] rdf:type calculus:Expression ;
rdf:subject example:myPredicate ;
rdf:object ( example:x example:y example:z ) ;
calculus:probability "0.95"^^xsd:double . example:myPredicate calculus:holdsFor ( example:x example:y example:z ) .
[] rdf:type example:MyPredicateExpression ;
rdf:object ( example:x example:y example:z ) ;
calculus:probability "0.95"^^xsd:double . RDF-star, Turtle-star, and TriG-starRDF-star, Turtle-star and TriG-star include syntax for quoting statements and for annotating asserted statements. The following example shows the syntax for annotating an asserted n-ary predicate calculus expression with a probability: example:myPredicate calculus:holdsFor ( example:x example:y example:z ) {| calculus:probability "0.95"^^xsd:double |} . The following example shows a quoted expression utilized in a statement. << example:myPredicate calculus:holdsFor ( example:x example:y example:z ) >> calculus:probability "0.95"^^xsd:double . However, having a list as the object of a quoted triple isn't valid Turtle-star syntax, so the example might resemble: @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix calculus: <http://www.w3.org/community/planning/calculus/ontology#> .
@prefix example: <http://example.org/#> .
_:b0 rdf:rest _:b1 ;
rdf:first example:x .
_:b1 rdf:rest _:b2 ;
rdf:first example:y .
_:b2 rdf:rest rdf:nil ;
rdf:first example:z .
<< example:myPredicate calculus:holdsFor _:b0 >>
calculus:probability "0.95"^^xsd:double . or @prefix calculus: <http://www.w3.org/community/planning/calculus/ontology#> .
@prefix example: <http://example.org/#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
<< example:myPredicate calculus:holdsFor _:b0 >>
calculus:probability "0.95"^^xsd:double .
_:b0 rdf:first example:x ; rdf:rest ( example:y example:z ) . @afs suggests, citing a previous discussion, that we might want to introduce a level of indirection for these scenarios, resembling: << example:myPredicate calculus:holdsFor _:b0 >>
other:observation [ calculus:probability "0.95"^^xsd:double ; other:accordingTo ex:Alice ] ;
other:observation [ calculus:probability "0.96"^^xsd:double ; other:accordingTo ex:Bob ] .
_:b0 rdf:first example:x ; rdf:rest ( example:y example:z ) . Describing Named GraphsThirdly, we could describe named graphs. example:graph1 {
example:myPredicate calculus:holdsFor ( example:x example:y example:z ) .
}
example:graph1 calculus:probability "0.95"^^xsd:double . |
Beta Was this translation helpful? Give feedback.
-
Below are some rough-draft sketches of representing n-ary predicate calculus in TriG. In planning domains, operators' preconditions and effects utilize n-ary predicate calculus expressions. The predicates utilized in these expressions are defined and interrelated in the planning domains.
I’m exploring how OWL2, SHACL, and DASH (e.g.,
dash:ListShape
) work with lists, towards being able to efficiently validate data containing n-ary predicate calculus expressions using their predicates' definitions. Is a predicate defined correctly? Does an expression’s argument list have the correct number of elements, as described by the expression's predicate's arity? Are an expression's arguments of the correct types, as described by the expression's predicate's definition?I'm also looking at reifying n-ary predicate calculus expressions, where
calculus:Expression
could be a subclass ofrdf:Statement
with constraints that a reified expression'srdf:subject
value would be of typecalculus:Predicate
, itsrdf:predicate
could be omitted as it would becalculus:holdsFor
, and itsrdf:object
value would be list shaped.Possibilities for defining n-ary predicates also include considering predicates to be as functions (see also: the Function Ontology) which receive a number of typed input arguments and return expressions, e.g.,
calculus:Expression
or subclasses thereof. Each predicate could be defined as returning instances of a predicate-specific subclass ofcalculus:Expression
.With respect to reification and nested expressions, I'm also looking at combining typed arguments with nestable expressions, e.g.,
p3(p4(x, y, z), w)
, perhaps utilizingcalculus:Expression
or predicate-specific subclasses thereof.I enjoy the simple TriG syntax for n-ary predicate calculus expressions:
In my opinion, remaining matters for consideration include how best to semantically define predicates.
Here is a rough-draft sketch of the potential applicability of FnO to the definition of predicates:
Any thoughts on these topics?
Beta Was this translation helpful? Give feedback.
All reactions