Hello Tim; smf:name includes a key feature for creating unambiguous
labels. This is key for things like autocomplete in Ensemble and
EVN. In your case, there are two labels that have the string "has
direct part", so the qname is shown so you can use the labels to
distinguish which URI the label refers to. This should be explained
in the description for smf:name, so we'll fix that. The label
algorithm is described in full in the TBE App Dev and Reference Guide
(see the More Information column at
http://www.topquadrant.com/products/TB_Ensemble.html).
If you don't want that label algorithm, i.e. you are OK with duplicate
labels, then you can write a function that will get the label or the
local name, if one doesn't exist. One example off the top of my head:
SELECT ?name
WHERE
{ OPTIONAL {?arg1 rdfs:label ?label}
LET (?name := smf:if(bound(?label), ?label, afn:localname(?arg1)))
}
-- Scott
On Mar 9, 3:00 pm, "Smith, Tim" <[email protected]> wrote:
> Hi,
>
> When I pass two different resources to smf:name, I get an interesting result.
>
> For one resource, smf:name returns the exact contents of rdfs:label as
> expected.
>
> For the other resource, smf:name returns the contents of rdfs:label with the
> prefix/shortname appended in []s.
>
> For example, the resource
>
> http://ontologies.semanticarts.com/gist/gist#hasDirectPart
>
> has a label of "has direct part" and a short name of "gist:hasDirectPart"
>
> However, smf:name(gist:hasDirectPart) returns the string:
>
> has direct part [gist:hasDirectPart]
>
> Only some resources are returned with the short name appended. I cannot see
> any difference in the resources. This happens to properties and instances.
> I have not tested classes.
>
> Any idea why this is happening? It tends to make SWPs look a bit odd with
> the short names appearing.
>
> Thanks for your help,
>
> Tim
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include 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