Ok thanks, change incorporated into the new 1.3.2-SNAPSHOT build.

Holger


On 10/22/2013 1:15, [email protected] wrote:
Hey Holger,

sorry for the delay. Yes this approach seems to work. I've extended SPINConstraints, changed check(Model ...) and check(Resource ...) to take Property as argument, and added corresponding methods that supply SPIN.constraint as the default property, without breaking the current contract.

Now I'm able to attach constraints using multiple different subproperties of spin:constraint and validate successfully.

I'm attaching the class, hope the file goes through.

Martynas
graphityhq.com

2013 m. spalis 11 d., penktadienis 00:53:02 UTC+2, Holger Knublauch ras(e.:

    On 10/11/2013 1:50, [email protected] <javascript:> wrote:
    Yes Holger, that might actually work. Looking forward to the next
    release!

    Just checking, have you tried the approach (of making the function
    public) and does it work? I do not have time right now to
    experiment with those things myself, so if you have a patch then I
    could turn around a new version quickly.

    Thanks,
    Holger



    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>.

--
-- 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
---
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.

--
-- 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
--- 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.

Reply via email to