Ok, i tried:

[cid:image001.png@01D7B0BB.B6965F40]

But the query stays red….




Dr. ir. H.M. (Michel) Bohms
Scientist Specialist
Structural Reliability

T +31 (0)88 866 31 07
M +31 (0)63 038 12 20
E michel.bo...@tno.nl<mailto:michel.bo...@tno.nl>

Location<http://www.tno.nl/locations/DTS>



[cid:image002.gif@01D7B0BB.B6965F40]<http://www.tno.nl/>

This message may contain information that is not intended for you. If you are 
not the addressee or if this message was sent to you by mistake, you are 
requested to inform the sender and delete the message. TNO accepts no liability 
for the content of this e-mail, for the manner in which you use it and for 
damage of any kind resulting from the risks inherent to the electronic 
transmission of messages.




From: topbraid-users@googlegroups.com <topbraid-users@googlegroups.com> On 
Behalf Of David Price
Sent: Thursday, September 23, 2021 3:08 PM
To: topbraid-users@googlegroups.com
Subject: Re: [topbraid-users] define transform rule




On 23 Sep 2021, at 13:44, 'Bohms, H.M. (Michel)' via TopBraid Suite Users 
<topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>> wrote:

Think you did not confuse me with target. I meant target class being the class 
i want to transform to...in the target ontology sa.

I think the below pattern does not do the job for me.
I have to create new instances of sa:Project etc. based on the existing 
MonsterLaag instance.

Based on!

Yes, I understood that.



That is...i use an attribute value of that instance to create an new target 
instance. Being projectNaam.

This transformation will in a sense normalise my original excel relation 
splitting it into subtables.

I just need to find again the way to create such an instance.

Some swp function i used to use in spin in the past...... and bind the result 
in a where clause i think...
???

SPARQL functions probably. BIND, IRI, CONCAT are usually enough.

See https://www.w3.org/TR/sparql11-query/#func-iri

Cheers,
David




Op 23 sep. 2021 13:50 schreef David Price 
<dpr...@topquadrant.com<mailto:dpr...@topquadrant.com>>:
Not quite and I think I confused you by mentioning “target” by which I did NOT 
mean sh:targetClass.

Put the actual SPARQLRule against the source class so that $this refers to 
instances of that class. There is no need for TripleRule. More like this but 
using $this in the WHERE rule to iterate through the instances of the class:

add to the source class sa-input:Monsterlaag :

 sh:rule [
                            a sh:SPARQLRule ;
                            sh:prefixes sa: ;
                            sh:construct """
                                          CONSTRUCT {
                                                         ?uri rdf:type 
sa:Project .
                                          }
                                          WHERE {
                                                         ?someproject 
sa-input:projectNaam ?projectNaam .
                                                         ? Uri = ….( 
projectNaam)
                                          }
                                          """ ;
              ] ;
.

but

WHERE {
$this sa-input:SomeAttrOf Monsterlaag ?value .
$this sa-input:SomeOtherAttrOf Monsterlaag ?valueother .
Etc

Cheers,
David



On 23 Sep 2021, at 12:22, 'Bohms, H.M. (Michel)' via TopBraid Suite Users 
<topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>> wrote:

              Ahh, ok, so in my case I would add to the source class 
sa-input:Monsterlaag :

sh:rule [
                            a sh:TripleRule ;
                            sh:subject (sh:this ATTRIBUTE projectName as URI) ;
                            sh:predicate rdf:type ;
                            sh:object sa:Project ;
              ] .

Apart from the yellow I can also think of putting the rule at the target:

sa:ProjectShape
              a sh:NodeShape ;
              sh:targetClass sa:Project ;
              sh:rule [
                            a sh:SPARQLRule ;
                            sh:prefixes sa: ;
                            sh:construct """
                                          CONSTRUCT {
                                                         ?uri rdf:type 
sa:Project .
                                          }
                                          WHERE {
                                                         ?someproject 
sa-input:projectNaam ?projectNaam .
                                                         ? Uri = ….( 
projectNaam)
                                          }
                                          """ ;
              ] ;
.

Again having a similar yellow part I have to find the right predefined function 
for…

???



Dr. ir. H.M. (Michel) Bohms
Scientist Specialist
Structural Reliability

T +31 (0)88 866 31 07
M +31 (0)63 038 12 20
E michel.bo...@tno.nl<mailto:michel.bo...@tno.nl>

Location<http://www.tno.nl/locations/DTS>



<image001.gif><http://www.tno.nl/>

This message may contain information that is not intended for you. If you are 
not the addressee or if this message was sent to you by mistake, you are 
requested to inform the sender and delete the message. TNO accepts no liability 
for the content of this e-mail, for the manner in which you use it and for 
damage of any kind resulting from the risks inherent to the electronic 
transmission of messages.




From: topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com> 
<topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>> On 
Behalf Of David Price
Sent: Thursday, September 23, 2021 1:02 PM
To: topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>
Subject: Re: [topbraid-users] define transform rule

SHACL rules are defined here:

https://w3c.github.io/shacl/shacl-af/#rules

What I typically do is make a separate graph for the rules and edit it in 
Composer, in the new Files feature or in Source Code editor. You can then 
include that graph and then remove it when the conversion is finished.

You define the rules (via sh:rule referencing a sh:SPARQLRule) on the “source” 
classes, and in the WHERE clause $this is instances of that classs, and then 
CONSTRUCT instances of “target" classes.

Cheers,
David

On 23 Sep 2021, at 11:01, 'Bohms, H.M. (Michel)' via TopBraid Suite Users 
<topbraid-users@googlegroups.com<mailto:topbraid-users@googlegroups.com>> wrote:

Hi David

In my input data from big excel I now have for instance the triple:

<urn:x-evn-master:def_shapes/bestekk_1654_N317__Dieren_-_Hoog_Keppel-1709-0500-000-01A1>
 sa-input:projectOmschrijving "bestekk 1654, N317 , Dieren - Hoog Keppel" ;

I want to use this info to instantiate a separate Project class.

I understand that here:
<image002.png>

I have to add someway a shacl-af rule doing:
Insert triple: "<current name space/bestekk 1654, N317 , Dieren - Hoog Keppel> 
rdf:type sa:Project

(actually I have to do that for all rows and because they are all in same 
project I will get duplicate triples that are only 1 in the end, I hope)

I have to do that for all classes (and for all other classes then the first: 
add also triple relating them)

Can you give my a hint how/where to best define these insert rule?

Thx a lot, Michel



Dr. ir. H.M. (Michel) Bohms
Scientist Specialist
Structural Reliability

T +31 (0)88 866 31 07
M +31 (0)63 038 12 20
E michel.bo...@tno.nl<mailto:michel.bo...@tno.nl>

Location<http://www.tno.nl/locations/DTS>



<image003.gif><http://www.tno.nl/>

This message may contain information that is not intended for you. If you are 
not the addressee or if this message was sent to you by mistake, you are 
requested to inform the sender and delete the message. TNO accepts no liability 
for the content of this e-mail, for the manner in which you use it and for 
damage of any kind resulting from the risks inherent to the electronic 
transmission of messages.





--
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 
topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/f994e032f1c4487c8b99e264295c6142%40tno.nl<https://groups.google.com/d/msgid/topbraid-users/f994e032f1c4487c8b99e264295c6142%40tno.nl?utm_medium=email&utm_source=footer>.

UK +44 (0) 7788 561308
US +1 (336) 283-0808

--
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 
topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/E7EF9BDA-AD24-4714-B93F-4D318B20BEFF%40topquadrant.com<https://groups.google.com/d/msgid/topbraid-users/E7EF9BDA-AD24-4714-B93F-4D318B20BEFF%40topquadrant.com?utm_medium=email&utm_source=footer>.

--
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 
topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/940ceef6a26d40d487179322e67580ae%40tno.nl<https://groups.google.com/d/msgid/topbraid-users/940ceef6a26d40d487179322e67580ae%40tno.nl?utm_medium=email&utm_source=footer>.

UK +44 (0) 7788 561308
US +1 (336) 283-0808


--
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 
topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/94A9A5FA-CDF9-483A-9A98-D983CE5C73A7%40topquadrant.com<https://groups.google.com/d/msgid/topbraid-users/94A9A5FA-CDF9-483A-9A98-D983CE5C73A7%40topquadrant.com?utm_medium=email&utm_source=footer>.


--
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 
topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/fe7c97f3-5fb1-4804-8d90-4e9351a738ca%40email.android.com<https://groups.google.com/d/msgid/topbraid-users/fe7c97f3-5fb1-4804-8d90-4e9351a738ca%40email.android.com?utm_medium=email&utm_source=footer>.

UK +44 (0) 7788 561308
US +1 (336) 283-0808

--
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 
topbraid-users+unsubscr...@googlegroups.com<mailto:topbraid-users+unsubscr...@googlegroups.com>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/EF4828D3-5D2F-413D-8911-FC2B9AFD531E%40topquadrant.com<https://groups.google.com/d/msgid/topbraid-users/EF4828D3-5D2F-413D-8911-FC2B9AFD531E%40topquadrant.com?utm_medium=email&utm_source=footer>.

-- 
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 topbraid-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/topbraid-users/3a069e6d2c974d999639fef0208bbc3d%40tno.nl.

Reply via email to