Leonard; There's a few things you will need to modify.  First, if the
objective is to change a URI, then you will need to bind that back
into a URI.  So the following may work.  Note the use of the graph
pattern syntax in CONSTRUCT,  LET has been replaced in SPARQL 1.1 with
the BIND syntax, and the name is fn:lower-case that takes 1 argument
(for a list of supported functions, see Help > Reference >
SPARQLMotion Functions reference)

CONSTRUCT
{  ?newuri rdfs:subPropertyOf :reading .
}
WHERE
{  ?P rdfs:subPropertyOf :reading .
   BIND (fn:lower-case (afn:localname( ?P) ) AS ?X).
   BIND (IRI(fn:concat(afn:namespace(?P), ?X)) AS ?newuri)
}

The SPARQL View, and command-completion in that view (think ctl-space)
are a real help when trying to debug a SPARQL query.

Anyway, if what you want to do in the end is to replace the existing
property names, CONSTRUCT won't help you much, as it just returns a
set of triples.  To apply those to the model you can use "Assert
selected constructed triples" in the view's context menu (upper-right
of menu).  Anyway, that will add the new values, but not delete the
old ones.

To do that, you can use SPARQL 1.1 Update to remove the old triples
and create new ones. An example:

WITH <graph URI, aka the base URI>
DELETE
{  ?P rdfs:subPropertyOf :reading .
   ?P ?p1 ?o1 .
}
INSERT
{  ?newuri rdfs:subPropertyOf :reading .
   ?newuri ?p1 ?o1 .
}
WHERE
{  ?P rdfs:subPropertyOf :reading .
   BIND (fn:lower-case (afn:localname( ?P) ) AS ?X).
   BIND (IRI(fn:concat(afn:namespace(?P), ?X)) AS ?newuri)
   ?P ?p1 ?o1 .
}

The WITH statement specifies what dataset the query operates on.  If
this is left off, the query will be applied to the *current* data
set.  In the SPARQL View, this is the dataset that you have open and
are viewing in the middle form view.

Note that this query copies the property values for URIs matching ?P,
and "moves" them to the newly created URI.  This copies all of the
triples associated with whatever is bound to ?P, including type
triples, etc.  Give that a try and let us know how it works.

-- Scott

On Apr 24, 5:42 pm, Leonard Jacuzzo <[email protected]> wrote:
> Hi list,
>
> It just struck me that I used 'subclass' instead of 'subproperty'..
>
> Any other tips to covert the property local names to lowercase?
>
> So the query I have so far should be:
>
> CONSTRUCT ?X rdfs:subPropertyOf :reading
> WHERE {?P rdfs:subClassOf :reading .
> LET (?X:= fn:lowercase (xsd:string, afn:localname( ?P) )).
>
>
>
>
>
>
>
> }

-- 
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 Ensemble, SPARQLMotion 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

Reply via email to