David,
It also may be the case that the composite children aren't text nodes, i.e.
don't have sxml:text values. My sample code below wouldn't work for the
order elements in my sample XML, because they have element content.
If the elements had multiple text nodes (for example, if the first item
element below was <item>A <b>really</b> big <i>cotton</i> shirt</item>) and
you wanted to pick the first text node composite child as the label, you
could try a WHERE clause like this:
WHERE {
?this composite:child ?cc .
?cc a smxl:TextNode .
?cc composite:index 1 .
?cc sxml:text ?label .
}
If that doesn't work for you, I'd need to see an example of the XML to get a
better idea.
Bob
From: [email protected]
[mailto:[email protected]] On Behalf Of David M Petrovich
Sent: Monday, November 14, 2011 8:31 AM
To: [email protected]
Subject: RE: [topbraid-users] adding a label in SPIN
thanks for the advice.
I noticed that when an instance has more than one composite:child, then a
label is not created. I'm assuming because the query is not stipulating
which composite child to use. The other issue is how best to label the
original instance if it has multiple composite:child relationships ?
thx, david
David Petrovich
Senior Principal Systems Engineer
Command And Control Systems, Security Solutions
Network Centric Systems
Raytheon Company
(business)
+1.727.302.3176
(cell)
+1.727.252.9231
(fax)
+1.727.768.8699
<mailto:[email protected]> [email protected]
8333 Bryan Dairy Rd.
Largo, Florida 33777 United States
<http://www.raytheon.com/> www.raytheon.com
Raytheon Sustainability
This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this message
in error, please so advise the sender by reply e-mail and delete this
message. Thank you for your cooperation.
Inactive hide details for "Bob Ducharme" ---11/10/2011 12:29:38 PM---If you
export the model to an RDF file, then after picking"Bob Ducharme"
---11/10/2011 12:29:38 PM---If you export the model to an RDF file, then
after picking "Export/Merge/Convert RDF Graphs" you'll
From:
"Bob Ducharme" <[email protected]>
To:
<[email protected]>
Date:
11/10/2011 12:29 PM
Subject:
RE: [topbraid-users] adding a label in SPIN
Sent by:
[email protected]
_____
If you export the model to an RDF file, then after picking
"Export/Merge/Convert RDF Graphs" you'll see that wizard for that offers
"Inference Graph" as one of the potential graphs to export into the file
being saved. Check that, and then the rdfs:label values will be included in
the disk file that gets created.
Bob
From: [email protected]
[mailto:[email protected]] On Behalf Of David M Petrovich
Sent: Thursday, November 10, 2011 8:32 AM
To: [email protected]
Subject: RE: [topbraid-users] adding a label in SPIN
thanks.
I put the code in the sml:ApplyConstruct and it works. However, how do I
make it permanent as opposed to inferred ?
thx,
david
David Petrovich
Senior Principal Systems Engineer
Command And Control Systems, Security Solutions
Network Centric Systems
Raytheon Company
(business)
+1.727.302.3176
(cell)
+1.727.252.9231
(fax)
+1.727.768.8699
<mailto:[email protected]> [email protected]
8333 Bryan Dairy Rd.
Largo, Florida 33777 United States
<http://www.raytheon.com/> www.raytheon.com
Raytheon Sustainability
This message contains information that may be confidential and privileged.
Unless you are the addressee (or authorized to receive mail for the
addressee), you should not use, copy or disclose to anyone this message or
any information contained in this message. If you have received this message
in error, please so advise the sender by reply e-mail and delete this
message. Thank you for your cooperation.
Inactive hide details for "Bob Ducharme" ---11/09/2011 06:33:25 PM---David,
How's this: I stored the following in an XML file, "Bob Ducharme"
---11/09/2011 06:33:25 PM---David, How's this: I stored the following in an
XML file, opened it up as semantic
From:
"Bob Ducharme" <[email protected]>
To:
<[email protected]>
Date:
11/09/2011 06:33 PM
Subject:
RE: [topbraid-users] adding a label in SPIN
Sent by:
[email protected]
_____
David,
How's this: I stored the following in an XML file, opened it up as semantic
XML, and imported sp.rdf and spin.rdf into the model.
<orders>
<order><item>shirt</item><color>blue</color></order>
<order><item>belt</item><color>black</color></order>
<order><item>socks</item><color>white</color></order>
</orders>
I then added the following spin:rule to the item class created by the
semantic XML import:
CONSTRUCT {
?this rdfs:label ?label .
}
WHERE {
?this composite:child ?cc .
?cc sxml:text ?label .
}
With TopSPIN included as one of the selected inference engines, running
inferences then gave each item instance an rdfs:label value of the PCDATA
from the item element (i.e. the sxml:text value of its composite:child).
Bob
-----Original Message-----
From: [email protected]
[ <mailto:[email protected]>
mailto:[email protected]] On Behalf Of
[email protected]
Sent: Wednesday, November 09, 2011 4:30 PM
To: TopBraid Suite Users
Subject: [topbraid-users] adding a label in SPIN
I have an xml file that I converted to RDF. I have about 35 classes
and each class has several instances.
I am trying to add a label to each instance, based on a
composite:child reference to another instance that contains the
smxml:text
Any examples to do this would be appreciated. I would like to do it
within SPIN.
thx
--
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>
http://groups.google.com/group/topbraid-users?hl=en
--
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>
http://groups.google.com/group/topbraid-users?hl=en
--
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
--
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
--
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
--
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
<<image001.gif>>
<<image002.gif>>
<<image004.png>>
<<image005.png>>
<<image006.png>>
<<image007.png>>
