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:

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
|
||||||||||||||||
On 23 Sep 2021, at 11:01, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:
Hi DavidIn 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
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-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/f994e032f1c4487c8b99e264295c6142%40tno.nl.
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…
???
|
|
|
| ||||||||
.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/E7EF9BDA-AD24-4714-B93F-4D318B20BEFF%40topquadrant.com.
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)}""" ;] ;.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/940ceef6a26d40d487179322e67580ae%40tno.nl.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/94A9A5FA-CDF9-483A-9A98-D983CE5C73A7%40topquadrant.com.
On 23 Sep 2021, at 13:44, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@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!
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...???
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/fe7c97f3-5fb1-4804-8d90-4e9351a738ca%40email.android.com.
Ok, i tried:

But the query stays red….
|
|
|
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/EF4828D3-5D2F-413D-8911-FC2B9AFD531E%40topquadrant.com.
On Sep 23, 2021, at 2:43 PM, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:
Ok, i tried:
<image001.png>
But the query stays red….
Dr. ir. H.M. (Michel) Bohms
Scientist Specialist
Structural ReliabilityT +31 (0)88 866 31 07
M +31 (0)63 038 12 20
E michel...@tno.nl
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/3a069e6d2c974d999639fef0208bbc3d%40tno.nl.
Ok, then indeed ‘sh:this’ makes sense then…
So I have to define the shape at the source being sa-input:MonsterLaag
Guess the red text is just a highlight of the sparql code, not an error …(I could save the shape so…)
The only question left then for now is the sh:prefixes
How can I indicate multiple of them
I assume I have to indicate those that are used in both the construct and the where part?
Many thx
|
|
|
| ||||||||
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/DAEDA1D4-952A-4F5A-831E-56EB45EB1F74%40topquadrant.com.
Wrt prefixes issue
Guess because sa-input is not in the list of name spaces:
PREFIX dash: http://datashapes.org/dash#
PREFIX dc: http://purl.org/dc/elements/1.1/
PREFIX dct: http://purl.org/dc/terms/
PREFIX edg: http://edg.topbraid.solutions/model/
PREFIX graphql: http://datashapes.org/graphql#
PREFIX metadata: http://topbraid.org/metadata#
PREFIX nen2660: https://w3id.org/nen2660/def#
PREFIX nen2660-term: https://w3id.org/nen2660/term#
PREFIX owl: http://www.w3.org/2002/07/owl#
PREFIX quantitykind: http://qudt.org/vocab/quantitykind/
PREFIX qudt: http://qudt.org/schema/qudt/
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX sa: https://w3id.org/sa/def#
PREFIX sh: http://www.w3.org/ns/shacl#
PREFIX skos: http://www.w3.org/2004/02/skos/core#
PREFIX skosxl: http://www.w3.org/2008/05/skos-xl#
PREFIX teamwork: http://topbraid.org/teamwork#
PREFIX time: http://www.w3.org/2006/time#
PREFIX unit: http://qudt.org/vocab/unit/
PREFIX xsd: http://www.w3.org/2001/XMLSchema#
Strange, because I imported sa-input.ttl, last item in:
<urn:x-evn-master:def_shapes>
a http://teamwork.topbraidlive.org/ontologyprojects#Ontology ;
a teamwork:Vocabulary ;
a owl:Ontology ;
graphql:publicClass sa-input:MonsterLaag ;
metadata:status metadata:UnderDevelopmentStatus ;
teamwork:externalGraphURI https://w3id.org/sa/owl/def ;
rdfs:label "def Shapes" ;
owl:imports http://datashapes.org/graphql ;
owl:imports http://qudt.org/schema/qudt ;
owl:imports http://qudt.org/vocab/quantitykind ;
owl:imports http://qudt.org/vocab/unit ;
owl:imports http://topbraid.org/teamworkconstraints ;
owl:imports http://www.w3.org/2004/02/skos/core ;
owl:imports http://www.w3.org/2006/time ;
owl:imports http://www.w3.org/ns/shacl ;
owl:imports https://w3id.org/nen2660/owl/def ;
owl:imports https://w3id.org/nen2660/rdfs/def ;
owl:imports https://w3id.org/sa-input/owl/def ;
.
In this file it says:
# baseURI: https://w3id.org/sa-input/owl/def
# imports: http://topbraid.org/tables
@prefix owl: http://www.w3.org/2002/07/owl# .
@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# .
@prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .
@prefix sa-input: https://w3id.org/sa-input/def# .
@prefix xsd: http://www.w3.org/2001/XMLSchema# .
And its seems to be known by EDG, given

It file (graph uri) IS shown in:

But the name space uri/prefix seems missing in the setting..
Any idea?
Can I just add it?
|
||||||||||||||||
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/d74cfebd40bf43e7a13d6376a45c9ef2%40tno.nl.
One more brainwave:
Is it the dash in sa-input giving problems?
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/b32f1556b828443787166ef5a1023fba%40tno.nl.
Seems not the case:
I reimported
Now:
PREFIX dash: http://datashapes.org/dash#
PREFIX dc: http://purl.org/dc/elements/1.1/
PREFIX dct: http://purl.org/dc/terms/
PREFIX edg: http://edg.topbraid.solutions/model/
PREFIX graphql: http://datashapes.org/graphql#
PREFIX metadata: http://topbraid.org/metadata#
PREFIX nen2660: https://w3id.org/nen2660/def#
PREFIX nen2660-term: https://w3id.org/nen2660/term#
PREFIX owl: http://www.w3.org/2002/07/owl#
PREFIX quantitykind: http://qudt.org/vocab/quantitykind/
PREFIX qudt: http://qudt.org/schema/qudt/
PREFIX rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns#
PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema#
PREFIX sa: https://w3id.org/sa/def#
PREFIX sa-input: https://w3id.org/sa-input/def#
PREFIX sh: http://www.w3.org/ns/shacl#
PREFIX skos: http://www.w3.org/2004/02/skos/core#
PREFIX skosxl: http://www.w3.org/2008/05/skos-xl#
PREFIX teamwork: http://topbraid.org/teamwork#
PREFIX time: http://www.w3.org/2006/time#
PREFIX unit: http://qudt.org/vocab/unit/
PREFIX xsd: http://www.w3.org/2001/XMLSchema#
Its in the list, but now:
It is not used by edg:

Totally lost….
When I look in code of MonsterLaag:
@prefix afn: http://jena.hpl.hp.com/ARQ/function# .
@prefix arg: http://spinrdf.org/arg# .
@prefix constant: http://qudt.org/vocab/constant/ .
@prefix creativecommons: http://creativecommons.org/ns# .
@prefix dash: http://datashapes.org/dash# .
@prefix dc: http://purl.org/dc/elements/1.1/ .
@prefix dct: http://purl.org/dc/terms/ .
@prefix dcterms: http://purl.org/dc/terms/ .
@prefix dtype: http://www.linkedmodel.org/schema/dtype# .
@prefix edg: http://edg.topbraid.solutions/model/ .
@prefix fn: http://www.w3.org/2005/xpath-functions# .
@prefix functions: http://qudt.org/2.1/schema/extensions/functions# .
@prefix graphql: http://datashapes.org/graphql# .
@prefix imports: http://qudt.org/2.1/schema/extensions/imports# .
@prefix mc: http://www.linkedmodel.org/owl/schema/core# .
@prefix metadata: http://topbraid.org/metadata# .
@prefix nen2660: https://w3id.org/nen2660/def# .
@prefix nen2660-term: https://w3id.org/nen2660/term# .
@prefix owl: http://www.w3.org/2002/07/owl# .
@prefix prefix: http://qudt.org/vocab/prefix/ .
@prefix prov: http://www.w3.org/ns/prov# .
@prefix qkdv: http://qudt.org/vocab/dimensionvector/ .
@prefix quantitykind: http://qudt.org/vocab/quantitykind/ .
@prefix qudt: http://qudt.org/schema/qudt/ .
@prefix qudt.type: http://qudt.org/vocab/type/ .
@prefix rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns# .
@prefix rdfs: http://www.w3.org/2000/01/rdf-schema# .
@prefix sa: https://w3id.org/sa/def# .
@prefix sh: http://www.w3.org/ns/shacl# .
@prefix skos: http://www.w3.org/2004/02/skos/core# .
@prefix skosxl: http://www.w3.org/2008/05/skos-xl# .
@prefix smf: http://topbraid.org/sparqlmotionfunctions# .
@prefix sou: http://qudt.org/vocab/sou/ .
@prefix sp: http://spinrdf.org/sp# .
@prefix spif: http://spinrdf.org/spif# .
@prefix spin: http://spinrdf.org/spin# .
@prefix spl: http://spinrdf.org/spl# .
@prefix swa: http://topbraid.org/swa# .
@prefix teamwork: http://topbraid.org/teamwork# .
@prefix teamworkconstraints: http://topbraid.org/teamworkconstraints# .
@prefix time: http://www.w3.org/2006/time# .
@prefix tosh: http://topbraid.org/tosh# .
@prefix unit: http://qudt.org/vocab/unit/ .
@prefix vaem: http://www.linkedmodel.org/schema/vaem# .
@prefix voag: http://voag.linkedmodel.org/voag/ .
@prefix xsd: http://www.w3.org/2001/XMLSchema# .
There is no sa-input there!
?????
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/21f232b4f20c40aca2ee7d1d717062b7%40tno.nl.