Martynas
2013 m. spalis 7 d., pirmadienis 03:47:18 UTC+2, Holger Knublauch
ral,æ½l,æ½:
Hi Martynas,
you may know that for SPIN rules it is possible to use
sub-properties of
spin:rule. People can define their own properties such as
my:prepRule
and my:postRule and use this for grouping. The SPIN API
exposes this by
allowing developers to pass in the rule predicate as an
argument. The
same mechanism could be used for constraints.
If you look at SPINConstraints, you should see a call to the
private method
l,æ½ l,æ½ l,æ½ l,æ½ l,æ½addConstraintViolations(results,
instance, SPIN.constraint,
false, stats, monitor);
where the SPIN.constraint property is hard-coded. In your
version, you
could make this method public, or expose alternative versions
of check
with an additional parameter for the sub-property, similar to
how
SPINInferences does it.
Would this work? I could add such a public method to the next
release.
In the absence of this change, the conservative solution is
to use
multiple files:
main.ttl
preconstraints.ttl (imports main.ttl)
postconstraints.ttl (imports main.ttl)
and then use the outer control logic to select which union
graph to run
over.
Cheers,
Holger
On 10/2/2013 21:26, [email protected] wrote:
> Hey,
>
> I'm receiving an RDF model which then goes through the
following steps:
> 1. pre-process SPIN validation (checking for missing
properties etc)
> 2. processing (building URIs for blank nodes, generating
hashes from
> passwords etc.)
> 3. post-process SPIN validation (checking for processed
properties,
> existing resources with same URI etc)
>
> What I need is a way to group constraint templates (or their
> instances?), so that some of them would only be executed
during
> pre-process, and others during post-process.
> I've noticed the practice of grouping templates into
super-classes,
> but it gets complicated as for example
dqc:MissingProperties could be
> a pre-process constraint in relation to foaf:name, but
post-process in
> relation to :passwordHash property.
>
> Any ideas on how to go about this? The code I'm currently
using to
> register and execute constraints is:
>
> l,æ½ l,æ½ getOntModel().add(model);
> l,æ½ l,æ½
SPINModuleRegistry.get().registerAll(getOntModel(), null);
> l,æ½ l,æ½ List<ConstraintViolation> cvs =
> SPINConstraints.check(getOntModel(), null);
>
> Thanks,
>
> Martynas
> graphityhq.com <http://graphityhq.com>
> --
> -- You received this message because you are subscribed to
the Google
> Group "TopBraid Suite Users", the topics of which include
Enterprise
> Vocabulary Network (EVN), TopBraid Composer, TopBraid Live,
TopBraid
> Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
> To post to this group, send email to
> [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/topbraid-users?hl=en
<http://groups.google.com/group/topbraid-users?hl=en>
> ---
> You received this message because you are subscribed to the
Google
> Groups "TopBraid Suite Users" group.
> To unsubscribe from this group and stop receiving emails
from it, send
> an email to [email protected].
> For more options, visit
https://groups.google.com/groups/opt_out
<https://groups.google.com/groups/opt_out>.
--
-- You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include
Enterprise Vocabulary Network (EVN), TopBraid Composer, TopBraid
Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to
[email protected] <javascript:>
To unsubscribe from this group, send email to
[email protected] <javascript:>
For more options, visit this group at
http://groups.google.com/group/topbraid-users?hl=en
<http://groups.google.com/group/topbraid-users?hl=en>
---
You received this message because you are subscribed to the
Google Groups "TopBraid Suite Users" group.
To unsubscribe from this group and stop receiving emails from it,
send an email to [email protected] <javascript:>.
For more options, visit https://groups.google.com/groups/opt_out
<https://groups.google.com/groups/opt_out>.