Re: [topbraid-users] breaking a list of tokens up?

2015-02-24 Thread Holger Knublauch

On 2/25/2015 16:36, Jack Hodges wrote:
Well, as a SPARQL query it (the suggested solution) worked perfectly, 
but when I put the same logic into a SPIN rule it didn't. Here is the 
context:


Sample list:

[TRANSDUCER^^xsd:NMTOKEN, PHYSICAL^^xsd:NMTOKEN, 
FUNCTION^^xsd:NMTOKEN]



is what ?obj2 in the query below looks like (which is type rdf:List)


SPARQL query (works great):

*SELECT*?o

*WHERE*{

*?arg1* owl:equivalentClass ?obj .

?obj owl:oneOf ?obj2 .

?obj2 (rdf:rest)*/rdf:first ?o .

}


and ?o is then bound to 3 strings: TRANSDUCER, PHYSICAL, and FUNCTION.


If I put the same SPARQL query into a SPIN rule:


*SELECT*?o

*WHERE*{

*?arg1* owl:equivalentClass ?obj .

?obj owl:oneOf ?obj2 .

?obj2 (rdf:rest)*/rdf:first ?o .

}


and bind ?arg1 to the same object that I used in the SPARQL query, I 
get just TRANSDUCER as a result.




SPIN functions can only ever return one result, and in your example the 
ordering of those values is arbitrary. If you need a function that 
produces multiple results, use spin:MagicProperty instead. If you need a 
SPIN rule, convert this into a CONSTRUCT query.


On your second question, yes I am sure we have lots of experience 
building complex strings out of SPARQL data. But if the logic becomes 
really complex, then using something like SWP is often the best choice. 
There you can operate on auxiliary result sets, do if-then-else and 
loops like in a programming language. You can turn SWP snippets into 
SPARQL functions, as described here:


http://www.topquadrant.com/2013/06/18/defining-sparql-functions-with-swp/

HTH
Holger




Very confusing. And what I want to do with this list of strings is to 
create a formatted string out of their combination. At first I thought 
I might be able to use spit:convertSPINRDFtoString in the SPARQL to 
create a string of strings and then operate on the new string. That 
didn't work because, even though the object I gave it is rdf:List the 
function complained that I was trying to convert a non list to a list. 
Then I thought I might try ui:concat but since my SPIN function isn't 
working it is hard to test this.



Question 1: Does anyone know why my SPARQL doesn't work in the SPIN 
function above?



Question 2: Has anyone need to and figured out how to build a 
formatted string without some complicated logic?



Thank as usual for any pointers...


Jack


On Saturday, January 24, 2015 at 8:16:17 PM UTC-8, Jack Hodges wrote:

Thank you Scott, did the trick perfectly.

Jack

On Monday, January 19, 2015 at 2:24:11 PM UTC-8, Scott Henninger
wrote:

Jack; No reason to use spif:split, given that the data is
already in RDF. Something like the following should work:

SELECT ?str
WHERE
{  ...
   ?s rdf:rest*/rdf:first ?o .
BIND (xsd:string(?o) AS ?str)
}

The rdf:rest*/rdf:first idiom will de-construct the RDF list
into elements.

-- Scott

Sent from my iPhone

On Jan 19, 2015, at 3:00 PM, Jack Hodges jhodg...@gmail.com
wrote:


I have a list of xsd:NMTOKENs that I want to render (using
SWP) in a table or chart. These items are in an
owl:equivalentClass as owl:oneOf items (an enumerated type).
I tried breaking them up with spif:split (oops, not a
string), and spif:foreach but neither worked. Here is an
example list:

[FOO^^xsd:NMTOKEN,

BAR^^xsd:NMTOKEN,

BAZ^^xsd:NMTOKEN]


With other ways of modeling enumerated types (e.g., by
representing FOO as an instance) I can do this, but this
modeling approach was used by someone else.


Is there a way to de-list these items in a SPARQL query?


Thanks,


Jack

-- 
You received this message because you are subscribed to the

Google Group TopBraid Suite Users, the topics of which
include Enterprise Vocabulary Network (EVN), Reference Data
Manager (RDM), TopBraid Composer, TopBraid Live, TopBraid
Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbrai...@googlegroups.com
---
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.
For more options, visit https://groups.google.com/d/optout
https://groups.google.com/d/optout.


--
You received this message because you are subscribed to the Google 
Group TopBraid Suite Users, the topics of which include Enterprise 
Vocabulary Network (EVN), Reference Data Manager (RDM), TopBraid 
Composer, TopBraid Live, TopBraid Insight, SPARQLMotion, SPARQL Web 
Pages and SPIN.

To post to this group, send email to topbraid-users@googlegroups.com
---
You received this message because you are subscribed to 

[topbraid-users] updatable variable within a SWP ui:foreach that isn't the loop counter and depends on result set

2015-02-24 Thread Jack Hodges
I am working on logic that will populate my SWP content based on some 
calculations that must take place locally. What I really need is a local 
variable that I can update the value of based on its previous value and the 
current set of values coming in through the result set. I tried using 'var 
foo = ...;' but didn't know how to reference 'foo' inside the '{= ...} 
expression. The '?foo' didn't work.

Is there a way to do this? At first I thought I might be able to achieve 
this by writing a SPIN rule but even though I can implement that 
calculation associated with the variable I cannot update the variable 
itself.

For example, lets say I have a ui:foreach as follows:

ui:forEach ui:indexVar=index ui:resultSet={= ?entries }{= spin:nl() } 
\\
  {= ui:newline() }var curry = {= eddl:boxStartYPosition(?index, curry, 
eddl:bcydist(?range)) };\draw (12,{= ?curry })...}
  {= ui:newline() }/ui:forEach

where ?range is defined within the SPARQL response in ?entries and ?curry 
was originally defined at the outer ui:group using 'let'.

Any ideas/pointers would certainly be appreciated!!! Thanks.

Jack

-- 
You received this message because you are subscribed to the Google Group 
TopBraid Suite Users, the topics of which include Enterprise Vocabulary 
Network (EVN), Reference Data Manager (RDM), TopBraid Composer, TopBraid Live, 
TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [topbraid-users] Project Upload in TBL with .sdb Files

2015-02-24 Thread Scott Henninger
Bart, I think that message reflects some previous limitations that no longer 
have relevance. We'll take it up as an issue.

Meanwhile, your scenario should work fine. As long as the SDB connector is the 
same in EVN and TBC-ME (via EVN Config Params), the respective systems will 
point to the same data on the back-end.

-- Scott


 On Feb 24, 2015, at 5:24 PM, Barton Petersen bart.peter...@gmail.com wrote:
 
 I would like to simulate a (production) deploy where the person doing the 
 deployment (potentially off shore) does not have access to TBL-ME and where I 
 don't have direct access to a TBL server.  Looks like this should be easy 
 because there is a Project Upload link in TBL and I could just give a .zip 
 of the project to offshore, but Project Upload comes with a warning:  if the 
 project contains connection files (such as .sdb) please upload directly from 
 TopBraid Composer.
 
 The way it's written seems like it's more a suggestion than a demand.  What 
 are the implications of doing a project upload this way when .sdb files are 
 involved?
 
 Bart
 -- 
 You received this message because you are subscribed to the Google Group 
 TopBraid Suite Users, the topics of which include Enterprise Vocabulary 
 Network (EVN), Reference Data Manager (RDM), TopBraid Composer, TopBraid 
 Live, TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
 To post to this group, send email to topbraid-users@googlegroups.com
 --- 
 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.
 For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Group 
TopBraid Suite Users, the topics of which include Enterprise Vocabulary 
Network (EVN), Reference Data Manager (RDM), TopBraid Composer, TopBraid Live, 
TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
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.
For more options, visit https://groups.google.com/d/optout.


[topbraid-users] Project Upload in TBL with .sdb Files

2015-02-24 Thread Barton Petersen
I would like to simulate a (production) deploy where the person doing the 
deployment (potentially off shore) does not have access to TBL-ME and where 
I don't have direct access to a TBL server.  Looks like this should be easy 
because there is a Project Upload link in TBL and I could just give a 
.zip of the project to offshore, but Project Upload comes with a warning: 
 if the project contains connection files (such as .sdb) please upload 
directly from TopBraid Composer.

The way it's written seems like it's more a suggestion than a demand.  What 
are the implications of doing a project upload this way when .sdb files are 
involved?

Bart

-- 
You received this message because you are subscribed to the Google Group 
TopBraid Suite Users, the topics of which include Enterprise Vocabulary 
Network (EVN), Reference Data Manager (RDM), TopBraid Composer, TopBraid Live, 
TopBraid Insight, SPARQLMotion, SPARQL Web Pages and SPIN.
To post to this group, send email to topbraid-users@googlegroups.com
--- 
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.
For more options, visit https://groups.google.com/d/optout.