On 13/08/2019 04:09, Jeff Lerman wrote:
Is there any way, with Jena (either the distributed version or via any
additional software anyone is aware of) to implement enforcement of
constraints on assertions, at the time of assertion?

Nothing built in. The reasoners do support a validation method which is implemented in the OWL reasoners and you can create your own validation rules in the generic rule reasoner [1]. However, there's no automatic checking of updates against such reasoner validation. For the OWL reasoner such enforcement would be impractically slow.

In particular, it’d be very helpful to be able to protect the graph(s) from
any assertion that breaks the assumption (in RDFS and OWL reasoners) that
rtfs:subClassOf “edges” form a directed acyclic graph.

There's no such assumption.

 Ideally, an UPDATE
(or other operation adding content to the store) would fail if that rule
(and maybe a small collection of similarly “basic” rules) would be violated
by storing the updated data.  For example, this would fail with an error:

prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX local: <http://localhost:8080/fuseki/jcl_test/data/>

INSERT DATA {
   GRAPH local:notadag {
     <c> rdfs:subClassOf <d> .
     <d> rdfs:subClassOf <c> .
   }
}

That's a perfectly legal set of assertions and equivalent to asserting

    <c> owl:equivalentClass <d> .

Indeed applications which limit themselves to RDFS for one reason or another have this as their only idiom for expressing class equivalence. Furthermore the OWL reasoners will effectively infer this pair from any direct or indirect expression of class equivalence.

It's also always the case that:

    <c> rdfs:subClassOf <c> .

Dave

[1] https://jena.apache.org/documentation/inference/#RULEnotes

Reply via email to