Hi Gary,

it might be best to wait for 5.4 on this. The area around SHACL has evolved quite a bit since 5.2. (We are near the code freeze for 5.4 at this stage).

Holger


On 26/09/2017 3:58, Gary Murphy wrote:
Hoping to break it down, I did try

sh:not [
a sh:Shape ;
sh:not [
sh:property [
sh:class schema:Thing ;
sh:path rdf:type ;
] ;
] ;
]

which does throw constraint violations when the data item is saved, which should prove that the rule works ...

Value does have shape [ a sh:Shape ; sh:not [ sh:property [ sh:class schema:Thing ; sh:path rdf:type ; ] ; ] ; ]

but sadly does not trigger dropping those invalid classes from the auto-complete list.


On Mon, Sep 25, 2017 at 1:54 PM, Gary Murphy <[email protected] <mailto:[email protected]>> wrote:

    Thanks for that example; I'm encouraged to see that I was
    essentially following the right path, however the essential
    difference is that your method works ;) -- I think I may be
    limited in this by the TB version as I'm trying to make this work
    in 5.2.2 where sh:NodeShape and dash:stem are both missing.

    On Mon, Sep 25, 2017 at 1:21 AM, Holger Knublauch
    <[email protected] <mailto:[email protected]>> wrote:

        Hi Gary,

        to support solution b), see the attached example. The SWA
        auto-complete widget currently requires sh:not to be used to
        point at shapes that the given matches do not conform to. You
        can exclude any non-schema.org <http://non-schema.org>
        resource by wrapping a dash:stem into another sh:not, as
        outlined. (I only tested with the upcoming 5.4 release, hoping
        the version that you have behaves similarly).

        HTH
        Holger




        On 21/09/2017 23:00, Gary Murphy wrote:
        I think it would be B -- in an edit form I use swa:Objects to
        allow changing or adding additional rdf:type classes, but
        would like to restrict the auto-complete listings to only
        include classes within the schema.org <http://schema.org>
        namespace, so I'm restricting a property where the values are
        classes.

        On Wed, Sep 20, 2017 at 10:00 PM, Holger Knublauch
        <[email protected] <mailto:[email protected]>> wrote:

            To help my understanding of your use case: Do you want to

            a) restrict a property to values that have an rdf:type
            from the schema.org <http://schema.org> namespace? (That
            could probably be achieved via sh:class schema:Thing)
            b) restrict a property to classes from the schema.org
            <http://schema.org> namespace (i.e. the values itself are
            classes)

            Holger



            On 21/09/2017 3:00, Gary Murphy wrote:
            This is my first dip into SHACL constraints, and what
            I'm needing might be easy to do, only I'm stuck at the
            last step...

            My objective is to constrain swa:URIResourceEditor to
            only offer auto-complete on an rdf:type with classes in
            the schema.org <http://schema.org> namespace, which is
            exactly what the comment on the URIResourceEditor says
            it can do:

                The auto-complete can apply a model-driven filter to
                the resources. If the subject has SHACL property
                constraints for the given predicate, then it will
                filter out all nodes where one of the shapes
                specified via sh:not is not fulfilled. Among others,
                this makes it possible to filter out system
                namespaces (via tosh:SystemNamespaceShape)


            Since I want this to apply to all schema.org
            <http://schema.org> subjects, I set out to add the
            sh:property constraint to schema:Thing only rather than
            the tosh:SystemNamespaceShape it seemed more appropriate
            to use the dash:StemConstraintComponent and this is
            where it stopped:  in the list of constraint shapes I
            find dash:StemConstraintComponent-stem (which would be
            the value of the IRI stem?) but no where to set the
            value of that stem.

            Am I going in the right direction with this? Do I need
            to define my own value shape somewhere that would define
            itself in terms of calling dash:StemConstraintComponent
            with the -stem parameter?

            Or should I define a new value shape, much like
            tosh:SystemNamespaceShape and using sparql to just test
            that the object starts-with the right namespace?
-- 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]
            <mailto:[email protected]>.
            For more options, visit
            https://groups.google.com/d/optout
            <https://groups.google.com/d/optout>.

-- 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]
            <mailto:[email protected]>.
            For more options, visit
            https://groups.google.com/d/optout
            <https://groups.google.com/d/optout>.


-- 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]
        <mailto:[email protected]>.
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.

-- 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]
        <mailto:[email protected]>.
        For more options, visit https://groups.google.com/d/optout
        <https://groups.google.com/d/optout>.



--
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] <mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
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/d/optout.

Reply via email to