PREFIX ss: <http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#>
PREFIX bsc: <https://w3id.org/def/basicsemantics-owl-complex#>
CONSTRUCT {
?uri a bsc:PropertyDef .
}
WHERE {
?namecell a ss:Cell .
?namecell ss:row 0 .
?namecell ss:cellContents ?name .
BIND (iri(concat("http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#",?name)) AS ?uri )
}
Works fine for getting more semantic data after xlsx import like:

But if the second and third row are special too like giving (optionally) datatype and unit) how can I best combine?
Like to have forinstance as result: ss:shear_modulus bsc:hasUnit Pa
Is there some smart way to get to the value of row2/3 or can I make a next query that is sequential to this one?
Thx for advice, Michel
|
|
|||||||||||||||||
|
|
|||||||||||||||||
More in general: if there are more patterns around for getting the cell contents in some semantics properties for rows/datapoints...that would be very welcome!
First I thought it would be easy but I am struggling a bit extracting via sparql constructs the row data becoming different instances involving “row-1 definitions” just knowing the row and column of a specific cell. Guess I just miss a general pattern walking the rows (as instances f datapoints) and next the columns (as triples for those instances referencing the first row) ....
Thx Michel
--
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/0f3fd26f32ce47ba85ffd41f0abdf41c%40tno.nl.
On Nov 18, 2019, at 3:35 AM, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:
More in general: if there are more patterns around for getting the cell contents in some semantics properties for rows/datapoints...that would be very welcome!First I thought it would be easy but I am struggling a bit extracting via sparql constructs the row data becoming different instances involving “row-1 definitions” just knowing the row and column of a specific cell. Guess I just miss a general pattern walking the rows (as instances f datapoints) and next the columns (as triples for those instances referencing the first row) ....Thx Michel
Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist
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.
Van: 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com>
Verzonden: Sunday, November 17, 2019 2:31 PM
Aan: topbrai...@googlegroups.com
Onderwerp: [topbraid-users] contsruct query question for sheetsPREFIX bsc: <https://w3id.org/def/basicsemantics-owl-complex#>CONSTRUCT {?uri a bsc:PropertyDef .}WHERE {?namecell a ss:Cell .?namecell ss:row 0 .?namecell ss:cellContents ?name .BIND (iri(concat("http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#",?name)) AS ?uri )}Works fine for getting more semantic data after xlsx import like:
<image002.jpg>
But if the second and third row are special too like giving (optionally) datatype and unit) how can I best combine?Like to have forinstance as result: ss:shear_modulus bsc:hasUnit PaIs there some smart way to get to the value of row2/3 or can I make a next query that is sequential to this one?Thx for advice, Michel
Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist
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/0f3fd26f32ce47ba85ffd41f0abdf41c%40tno.nl.
--
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/69b04a966a304fa3bbc21214989e7fd7%40tno.nl.
Hi Irene, see after >
Michel,
General pattern for this is to use SPARQL.
It is hard to reply more specifically without looking at your spreadsheet and I do not have time right now to loo at it.
> I have a simple sheet with 3 special rows on top:
> 1. attribuut-name
> 2. optional unit
> 3. optional datatype
If you are processing a cell with row X, column Y and your row 1 contains names of the properties that you will use to create the URIs of the properties, then you can always do
?dataCell ss:row ?x
?dataCell ss :column ?y.
?dataCell ss:cellContents ?dataValue
?propertyCell ss:row 1.
?propertyCell ss :column ?y.
?propertyCell ss:cellContents ?propertyValue
FILTER (?x > 1)
> ok!, guess my pattern would be like:
?dataCell ss:row ?x
?dataCell ss :column ?y.
?dataCell ss:cellContents ?dataValue
?propertyCell ss:row 1.
?propertyCell ss :column ?y.
?propertyCell ss:cellContents ?propertyValue
?unitCell ss:row 1.
?unitCell ss :column ?y.
?unitCell ss:cellContents ?unitValue
?datatypeCell ss:row 1.
?datatypeCell ss :column ?y.
?datatypeCell ss:cellContents ?datatypeValue
FILTER (?x > 3)
Further, if your data is tabular and the first row represents properties, you can just double click on the spreadsheet to open. And avoid going through this type of import.
> I actually found the semantic table option but indeed sparql might be more flexible to cope with the special rows (and with alternative ways of instantiating involving “complex properties”).
There are different importers for spreadsheets. This white paper may be of use https://www.topquadrant.com/download/using-topbraid-to-work-with-spreadsheet-data/?wpdmdl=15930&refresh=5dd36e53b83261574137427, although it is a bit outdated.
> I guess your (total) query above is somehow part of the semantic table import under the hood? Is it somewhere to be found explicitly/complete? Despite your hints I struggle with the actual construct part (instantiation of the row-instances).
> Thanks a lot, also for your advice so far! Michel
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/074839FD-76A8-4355-B793-6257779CB2DA%40topquadrant.com.
On 19 Nov 2019, at 08:12, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:?dataCell ss:row ?x?dataCell ss :column ?y.?dataCell ss:cellContents ?dataValue?propertyCell ss:row 1.?propertyCell ss :column ?y.?propertyCell ss:cellContents ?propertyValue?unitCell ss:row 1.?unitCell ss :column ?y.?unitCell ss:cellContents ?unitValue?datatypeCell ss:row 1.?datatypeCell ss :column ?y.?datatypeCell ss:cellContents ?datatypeValueFILTER (?x > 3)
Despite your hints I struggle with the actual construct part (instantiation of the row-instances).
Thx Richard
We will experiment!
Greetings Michel
|
|
|
| |||||||||
--
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/9E0CA9F7-2D4D-4604-9164-4FD010B8866B%40topquadrant.com.
Hmmmm
PREFIX ss: <http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#>
PREFIX bsc: <https://w3id.org/def/basicsemantics-owl-complex#>
CONSTRUCT {
?uri a bsc:PropertyDef .
}
WHERE {
?dataCell ss:row ?x .
?dataCell ss:column ?y .
?dataCell ss:cellContents ?dataValue .
?propertyCell ss:row 0 .
?propertyCell ss:column ?y .
?propertyCell ss:cellContents ?property .
?unitCell ss:row 1 .
?unitCell ss:column ?y .
OPTIONAL { ?unitCell ss:cellContents ?unit }
?datatypeCell ss:row 2 .
?datatypeCell ss:column ?y .
OPTIONAL {?datatypeCell ss:cellContents ?datatype }
BIND (iri(concat("http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#",?property)) AS ?uri )
FILTER ( ?x > 2)}
Gives me only instances for property names (first row, row 0) for which there are units defined in second row 1.
I thought that putting optional there would give them all.....
Adding OPTIONAL also for the general ?dataCell ss:cellContents ?dataValue . does not help
Where is my thinking wrong?
Thx Michel
|
|
|
| |||||||||
Verzonden: Tuesday, November 19, 2019 10:11 AM
Aan: topbraid-users list <topbrai...@googlegroups.com>
CC: Bektas, K.E. (Esra) <esra....@tno.nl>
--
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/9E0CA9F7-2D4D-4604-9164-4FD010B8866B%40topquadrant.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/4d94a0d7d16948c7914f9c3ac03657cb%40tno.nl.
That’s it 😊 thx.
Still trying to understand why...because they are “bound together”?
|
|
|
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/77F21491-7E6A-46A3-90EC-B9832883A709%40topquadrant.com.
On 20 Nov 2019, at 13:56, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:That’s it 😊 thx.Still trying to understand why...because they are “bound together”?
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/97739fde12a94b4c9b92378a97b798af%40tno.nl.
On Nov 20, 2019, at 8:56 AM, 'Bohms, H.M. (Michel)' via TopBraid Suite Users <topbrai...@googlegroups.com> wrote:
That’s it 😊 thx.Still trying to understand why...because they are “bound together”?
Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/97739fde12a94b4c9b92378a97b798af%40tno.nl.
Hi Irene, Richard
Thx for the explanations!
I had not realised that with the sheet-import empty cells were not generated at all!
Greetings Michel
|
|
|
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/B8E1107F-324D-414D-B628-12578963B6C7%40topquadrant.com.
Hi Irene, Richard
Thx for the explanations!
I had not realised that with the sheet-import empty cells were not generated at all!
Greetings Michel
Dr. ir. H.M. (Michel) Böhms
Senior Data Scientist
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/114a9ef54ed04e1a9a977ea6b9a26c23%40tno.nl.
That is exactly what I now do, by select variants making sure that I can get all the data
Now I start systematically constructing new triples, involving constructed URIs, based on it.
thx
|
|
|
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/D0B3C21B-09C9-4860-8538-6805DA2E6608%40topquadrant.com.
Hi Richard,
Suppose I want to generate for each sheet cell found (?dataCell binding) a unique uri.
How would I do that? Kind of spif:buildURI?
Clearly the red is not the way, no instances of bsc:Property are generated:
Guess I need some function in between for ?dataCell ?
PREFIX ss: <http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#>
PREFIX bsc: <https://w3id.org/def/basicsemantics-owl-complex#>
CONSTRUCT {
?uri1 a bsc:PropertyDef .
?uri2 a bsc:Property}
WHERE {
?dataCell ss:row ?x .
?dataCell ss:column ?y .
?dataCell ss:cellContents ?dataValue .
?propertyCell ss:row 0 .
?propertyCell ss:column ?y .
?propertyCell ss:cellContents ?property .
OPTIONAL { ?unitCell ss:row 1 .
?unitCell ss:column ?y .
?unitCell ss:cellContents ?unit . }
OPTIONAL { ?datatypeCell ss:row 2 .
?datatypeCell ss:column ?y .
?datatypeCell ss:cellContents ?datatype }
BIND (iri(concat("http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#",?property)) AS ?uri1 ) .
BIND (iri(concat("http://www.topbraidcomposer.org/owl/2006/08/spreadsheets.owl#",?dataCell)) AS ?uri2 )
FILTER ( ?x > 2)}
Thx for the tip; guess the last tip I need to make my further mapping complete...
michel
|
|
|
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/D5324295-FD99-46A1-9685-D672D42EC4DA%40topquadrant.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/3722a8f1b89b447f95902aff5110b6a0%40tno.nl.
?dataCell ss:cellContents ?dataValue .
To view this discussion on the web visit https://groups.google.com/d/msgid/topbraid-users/CAF0WbnL%3DCsLVOU%3DsjrkLxhG8PZWwdUhksXWgmUq_%3DvSD_K%3DfMA%40mail.gmail.com.
<image001.gif>