Hi Ilya,
magic properties do not operate on ?this as the argument, but use ?arg1.
The effect of the query below is that ?this will be unbound and thus
match to every resource that has any prefLabel - that's why you see it
for all instances and with all values.
HTH
Holger
On 27/03/2017 23:34, Ilya Ushakov wrote:
Hi Everyone,
In my previous post i had mentioned that everything works fine. But
today, i have noticed that everything works but not as i expected.
I created magic property with spin:body
SELECT ?displayLabel
WHERE {
?this skos:prefLabel ?label .
OPTIONAL {
?this trevn:comment ?comment .
} .
BIND (smf:if(bound(?comment), smf:buildString("{?label}
{?comment}"), ?label) AS ?displayLabel) .
}
and rdfs:domain skos:Concept.
2. In evn I added trevn:comment value to three nodes in taxonomy tree.
3. As result I see these three values for any node in taxonomy
independent on has the node value of trevn:comment property or not
(see fig1).
It looks like that this magic property connected to skos:Concept class.
I need that this magic property would be related to every instance of
skos:Concept e. g. every node would have own value of this property.
So for example
for NODE 1 :
skos:prefLabel = prefLabel_node_1
trevn:comment = comment_node_1
so diplayLabel should be = prefLabel_node_1 comment_node_1
for NODE 2 :
skos:prefLabel = prefLabel_node_2
trevn:comment = comment_node_2
so diplayLabel should be = prefLabel_node_2 comment_node_2
etc.
now for every node I have displayLabel: prefLabel_node_1 comment_node_1
prefLabel_node_2 comment_node_2.
In attachment, you can see that selected node Administrative Practice
has displayLabel:
displayLabel:
Admiralty test comment
Agriculture comment
Corporations fdfghfghfghfghdfg.
instead of
displayLabel: Administrative Practice.
<https://lh3.googleusercontent.com/-Tw3ZtFQgK_o/WNkU1vi1VGI/AAAAAAAAAA4/3z8v0u3sHCAYxP5Y4Y0oK6ritlphB0sgQCLcB/s1600/fig1.png>
So, Is it possible to assign magicProperty to instance of
skos:Concept? if no, which env opportunity is most suitable for this?
On Friday, March 24, 2017 at 2:51:36 PM UTC+1, Ilya Ushakov wrote:
Hi everyone,
I need to have calculated field on skos:concept named displayLabel.
The value of displayLabel should be concatenation of
"skos:prefLabel" and "comment" fields.
For this goal I made next:
1. Created comment and displayLabel properties
Both of them have:
rdf:type owl:DatatypeProperty.
rdfs:domain skos:Concept.
rdfs:range xsd:string
2. On skos:Concept I created spin:rule:
CONSTRUCT {
?this tr:displayLabel ?displayLabel .
}
WHERE {
BIND (trevn:displayLabelVal(?this) AS ?displayLabel) .
BIND (smf:trace("INFO: displayLabel {?1}", ?displayLabel) AS
?dummy) .
}
the code of magicProperty trevn:displayLabelVal:
SELECT ?displayLabel
WHERE {
?arg1 skos:prefLabel ?label .
OPTIONAL {
?arg1 trevn:comment ?comment .
} .
BIND (smf:if(bound(?comment), smf:buildString("{?label}
{?comment}"), ?label) AS ?displayLabel) .
}
3. I created test taxonomy and open it in TopBraid Composer.
When i run inside TopBraidComposer (Inference->Run Inference)
everything works fine.
4. When it runs inside EVN (after deploying), nothing is happening.
I even see nothing in tomcat logs.
Apparently spin:rule was not being executed.
I added graph with my properties to "includes" on General tab of
taxonomy, but there were no any effects.
So, is it possible to run spin:rules on skos:Concept instances?
If, yes, what i did wrong?
--
You received this message because you are subscribed to the Google
Group "TopBraid Suite Users", the topics of which include the TopBraid
Suite family of products and its base technologies such as
SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
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 Group "TopBraid
Suite Users", the topics of which include the TopBraid Suite family of products and
its base technologies such as SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to [email protected]
---
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.