uri-generation issue shacl/sparql

20 views
Skip to first unread message

Bohms, H.M. (Michel)

unread,
Mar 2, 2022, 10:36:40 AM3/2/22
to topbrai...@googlegroups.com

Why no Meting_1 result executing:

 

 

When I delete the 3rd part I get (it right):

 

 

So do I miss some function for the 3rd component?

 

Thx Michel

 

 

Michel Böhms
Data Scientist

Unit Buildings, Infrastructure & Maritime


Mobile +31 630381220
E-mail  
michel...@tno.nl

Location

 

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.

 

 

 

David Price

unread,
Mar 2, 2022, 11:40:32 AM3/2/22
to 'Felix Sasaki' via TopBraid Suite Users
Likely you need to cast ?time to be xsd:string. CONCAT requires strings.




Cheers,
David

On 2 Mar 2022, at 15:36, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:

Why no Meting_1 result executing:
 
<image001.png>
 
When I delete the 3rd part I get (it right):
 
<image003.png>
 
So do I miss some function for the 3rd component?
 
Thx Michel
 
 
Michel Böhms
Data Scientist
Unit Buildings, Infrastructure & Maritime
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/f65be9895ec9475c8954b836115c84fc%40tno.nl.


Richard Cyganiak

unread,
Mar 2, 2022, 11:50:17 AM3/2/22
to topbraid-users list
On 2 Mar 2022, at 16:40, David Price <dpr...@topquadrant.com> wrote:

Likely you need to cast ?time to be xsd:string. CONCAT requires strings.

Not just CONCAT but also ENCODE_FOR_URI. I would think both ?time and ?out_1 need to be cast to string.

..., encode_for_uri(str(?time)), encode_for_uri(str(?out_1))

Richard




<image001.png>

Bohms, H.M. (Michel)

unread,
Mar 2, 2022, 12:12:36 PM3/2/22
to topbrai...@googlegroups.com

?time is already string…

 

 

 

Michel Böhms
Data Scientist

Unit Buildings, Infrastructure & Maritime


Mobile +31 630381220
E-mail  
michel...@tno.nl

Location

 

Bohms, H.M. (Michel)

unread,
Mar 2, 2022, 12:19:31 PM3/2/22
to topbrai...@googlegroups.com

?time already being a string I applied to third term:

 

SELECT *

WHERE {

         ?this rdf:type ri:Meting .

         ?this ri:time ?time .

OPTIONAL { ?this ri:out_1 ?out_1 } .

         BIND (IRI (CONCAT (http://www.w3.org/ns/sosa/_, encode_for_uri (?time), encode_for_uri (str(?out_1)))) AS ?meting1) .

}

 

Now i have the right result:

 

 

It looked strange but is I guess as expected:

All : are encoded. I will put siome extra underscores in…

 

Thx a lot! Michel

 

Ps

Hope I now get it to work in the same way in shacl construct rule….

 

 

 

Michel Böhms
Data Scientist

Unit Buildings, Infrastructure & Maritime


Mobile +31 630381220
E-mail  
michel...@tno.nl

Location

 

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: topbrai...@googlegroups.com <topbrai...@googlegroups.com> On Behalf Of Richard Cyganiak
Sent: woensdag 2 maart 2022 17:50
To: topbraid-users list <topbrai...@googlegroups.com>
Subject: Re: [topbraid-users] uri-generation issue shacl/sparql

 

 

On 2 Mar 2022, at 16:40, David Price <dpr...@topquadrant.com> wrote:

David Price

unread,
Mar 2, 2022, 12:19:33 PM3/2/22
to 'Felix Sasaki' via TopBraid Suite Users
It is almost always that CONCAT needs strings and something provided is not a string, so if not the one I suggested then check the other variables. You may need to BIND them outside the CONCAT so you can see their datatype.

Cheers,
David

On 2 Mar 2022, at 17:12, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:

?time is already string…
 
 
 
Michel Böhms
Data Scientist
Unit Buildings, Infrastructure & Maritime
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: topbrai...@googlegroups.com <topbrai...@googlegroups.com> On Behalf Of David Price
Sent: woensdag 2 maart 2022 17:40
To: 'Felix Sasaki' via TopBraid Suite Users <topbrai...@googlegroups.com>
Subject: Re: [topbraid-users] uri-generation issue shacl/sparql
 
Likely you need to cast ?time to be xsd:string. CONCAT requires strings.
 
 
<image003.png>

Bohms, H.M. (Michel)

unread,
Mar 2, 2022, 1:35:25 PM3/2/22
to topbrai...@googlegroups.com

Also shacl rules work perfectly now (mapping my tab-delimited txt measurement file via excel to w3c sosa & qudt ontology)!

Thx a lot! michel

 

 

 

 

Michel Böhms
Data Scientist

Unit Buildings, Infrastructure & Maritime


Mobile +31 630381220
E-mail  
michel...@tno.nl

Location

 

Reply all
Reply to author
Forward
0 new messages