Seeing the release of TopBraid 5.1.4 reminded me that I would like to suggest the addition of the square root function to your standard library of math functions. I know others have bumped into this omission.
In the meantime, I went ahead and defined it with the following code:
rules:sqrt
rdf:type spin:Function ;
spin:constraint [
rdf:type spl:Argument ;
spl:predicate sp:arg1 ;
] ;
spin:returnType xsd:float ;
spinx:javaScriptCode "return Math.sqrt (arg1)"^^xsd:string ;
rdfs:comment "Compute the square root of a number."^^xsd:string ;
rdfs:subClassOf spin:Functions ;
…which requires importing http://spinrdf.org/spinx (from /TopBraid/SPIN/spinx.ttl)
I know it’s easy for users to just do this, but many people may not want to figure out how to bring in javascript snippets and locate the Math library.
Of course, you would use a different prefix than “rules” which I did.
- Steve
Steven R. Ray, Ph.D.
Distinguished Research Fellow
Carnegie Mellon University
NASA Research Park
Building 23 (MS 23-11)
P.O. Box 1
Moffett Field, CA 94305-0001
Email: stev...@sv.cmu.edu
Phone: (650) 587-3780
Cell: (202) 316-6481
Skype: steverayconsulting
--
You received this message because you are subscribed to the Google Group "TopBraid Suite Users", the topics of which include the TopBraid Suite family of products and its base technologies such as 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.
--
Thanks, Holger,
That’s good to know.
Generally, when I’m looking for functions to use, I refer to the “TopBraid SPARQL Functions reference” section in TBC Help.
Updating that with either the new afn: functions, or a link to http://jena.apache.org/documentation/query/library-function.html in the help file would be a good way for users to know what is available.
- Steve
Steven R. Ray, Ph.D.
Distinguished Research Fellow
Carnegie Mellon University
NASA Research Park
Building 23 (MS 23-11)
P.O. Box 1
Moffett Field, CA 94305-0001
Email: stev...@sv.cmu.edu
Phone: (650) 587-3780
Cell: (202) 316-6481
Skype: steverayconsulting