Re: [Virtuoso-users] XPath normalize-space function support

2015-09-08 Thread Hugh Williams
Hi Lorena,

What is the actual query you are executing using  the “bif:” prefix  that is 
resulting in the "SP031: SPARQL compiler: Function name "bif:normalize-space" 
contains invalid characters; this may be an attempt of bypassing security 
restrictions” error ?

Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.  //  http://www.openlinksw.com/
Weblog   -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers

> On 8 Sep 2015, at 21:50, Lorena Etcheverry  wrote:
> 
> Hi
> 
> I'd like to use this  function 
> http://www.w3.org/TR/xpath-functions/#func-normalize-space in a SPARQL 
> query in Virtuoso 7.
> Is it available?
> If I declare the prefix fn  as
> prefix fn: 
> and then use the function as
> 
> fn:normalize-space(str(?s))
> 
> I retrieve the following error
> 
> Virtuoso 42001 Error SR185: Undefined procedure 
> DB.DBA.http://www.w3.org/2005/xpath-functionsnormalize-space.
> 
> 
> I've also found a function with the same name and behavior in Virtuoso 
> documentation 
> (http://docs.openlinksw.com/virtuoso/xpf_normalize_space.html).
> Is it possible to use this function in a SPARQL query?
> I've tried to use it with the prefix bif, but I also get an error
> 
> Virtuoso 37000 Error SP031: SPARQL compiler: Function name 
> "bif:normalize-space" contains invalid characters; this may be an attempt of 
> bypassing security restrictions
> 
> best regards,
> 
> Lorena
> 
> 
> 
> 
> 
> --
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users

--
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Problem with federated query

2015-09-08 Thread Hugh Williams
Hi Francesco,

So you are saying if 2 D2R servers are using the initial ( or both ) query run 
fine, but with Virtuoso initiating the federated query it fails querying 
against the D2R server instance ? If so is this D2R server instance accessible 
remotely such that we can try from here ?

Also, you can try turning on Virtuoso tracing to obtain more information on the 
calls being made and error written to the log, using the trace_on() function [1]

[1] http://docs.openlinksw.com/virtuoso/fn_trace_on.html 


Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.  //  http://www.openlinksw.com/
Weblog   -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers

> On 7 Sep 2015, at 16:56, Francesco Balzu  wrote:
> 
> Hi !!
> 
> I have a problem with the following query :
> 
> select *
> where {
>  ?sensor rdf:type km4c:SensorSite.
>  ?sensor dcterms:identifier 'FI055ZTL00901'.
>  SERVICE >{   
>  SELECT ?sensor ?obs
>  {  
>  ?obs km4c:isObservationOf ?sensor.   
>   } limit 10   
>  }
> }
> 
> I get the following error:
> 
> Virtuoso RDFZZ Error DB.DBA.SPARQL_REXEC('http://localhost:2020/sparql' 
> , ...) returned Content-Type 'text/html' 
> status 'HTTP/1.1 400 Parse error:   SELECT ?obs  WHERE {  ?obs   .  
> FILTER (isREF ( )) }  Lexical error at line 3, column 19.  Encountered: " " ('
> 
> 
> 
> Error 400 Parse error: 
>  SELECT ?obs
>  WHERE {  ?obs   .
>  FILTER (isREF ( )) }
> Lexical error at line 3, column 19.  Encountered: " " (32), after : "isREF"
> 
> HTTP ERROR 400
> Problem accessing /sparql. Reason:
> Parse error: 
>  SELECT ?obs
>  WHERE {  ?obs   .
>  FILTER (isREF ( )) }
> Lexical error at line 3, column 19.  Encountered: " " (32), after : 
> "isREF"Powered by Jetty://
> 
> The server running at http://localhost:2020  is a D2R 
> server and http://localhost:2020/sparql  is a 
> SPARQL endpoint.
> Initially I thought it was just a D2R error, but the strange thing is that if 
> I select only ?obs inside the SERVICE clause, that is if I run the following 
> query :
> select *
> where {
>  ?sensor rdf:type km4c:SensorSite.
>  ?sensor dcterms:identifier 'FI055ZTL00901'.
>  SERVICE >{   
>  SELECT  ?obs
>  {  
>  ?obs km4c:isObservationOf ?sensor.   
>   } limit 10   
>  }
> }
> I get the correct result. The problem with the latter query is that the 
> variable sensor seems not bound to any value when the graph pattern inside 
> the SERVICE clause is matched in D2R. That's why I'd prefer the former 
> solution. The variable sensor should be bound to an IRI.
> If I run the former query from Fuseki server I get the correct result, so I 
> was wondering why I'm not able to run it from Virtuoso.
> Maybe can't I query a D2R endpoint from a Virtuoso endpoint?
> Or do you think the problem is in D2R? 
> 
> Thanks a lot for your help and your time.
> 
> Best Regards,
> Francesco Balzano.
> 
> --
> ___
> Virtuoso-users mailing list
> Virtuoso-users@lists.sourceforge.net 
> 
> https://lists.sourceforge.net/lists/listinfo/virtuoso-users 
> 
--
Monitor Your Dynamic Infrastructure at Any Scale With Datadog!
Get real-time metrics from all of your servers, apps and tools
in one place.
SourceForge users - Click here to start your Free Trial of Datadog now!
http://pubads.g.doubleclick.net/gampad/clk?id=241902991&iu=/4140___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


[Virtuoso-users] XPath normalize-space function support

2015-09-08 Thread Lorena Etcheverry
Hi

I'd like to use this  function 
http://www.w3.org/TR/xpath-functions/#func-normalize-space in a SPARQL 
query in Virtuoso 7.
Is it available?
If I declare the prefix fn  as
prefix fn: 
and then use the function as

fn:normalize-space(str(?s))

I retrieve the following error

Virtuoso 42001 Error SR185: Undefined procedure 
DB.DBA.http://www.w3.org/2005/xpath-functionsnormalize-space.


I've also found a function with the same name and behavior in Virtuoso 
documentation 
(http://docs.openlinksw.com/virtuoso/xpf_normalize_space.html).
Is it possible to use this function in a SPARQL query?
I've tried to use it with the prefix bif, but I also get an error

Virtuoso 37000 Error SP031: SPARQL compiler: Function name 
"bif:normalize-space" contains invalid characters; this may be an attempt of 
bypassing security restrictions

best regards,

Lorena





--
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] Parameterizing SPARQL in Virtuoso/PL

2015-09-08 Thread Davis, Daniel (NIH/NLM) [C]
Hugh,

Thanks, using ?? is better binding that the solution I came up with so far, 
which was sprintf() and SPARQL_EVAL().   This will lead the graph 
 available on http://id.nlm.nih.gov/mesh/query (UI) 
and http://id.nlm.nih.gov/mesh/sparql (endpoint) to retain information about 
deleted supplementary concepts within the year and other deleted subjects 
year-over-year.

Thanks again,

Dan Davis, Systems/Applications Architect (Contractor),
Office of Computer and Communications Systems,
National Library of Medicine, NIH

From: Hugh Williams [mailto:hwilli...@openlinksw.com]
Sent: Sunday, September 06, 2015 8:56 PM
To: Davis, Daniel (NIH/NLM) [C] 
Cc: virtuoso-users@lists.sourceforge.net
Subject: Re: [Virtuoso-users] Parameterizing SPARQL in Virtuoso/PL

Hi Daniel,

Details on passing parameters in SPARQL queries can be found at:

  http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsparqlinline

Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.  //  http://www.openlinksw.com/
Weblog   -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers

On 4 Sep 2015, at 21:05, Davis, Daniel (NIH/NLM) [C] 
mailto:daniel.da...@nih.gov>> wrote:

I’m trying to implement a versioning policy our linked data, and when I see , 
located athttp://id.nlm.nih.gov/mesh.   We currently load the triples each 
night, and we want to start being sensitive to which subjects no longer appear 
in the graph, updating the triples of subjects that exist in the new schema, 
and marking the subjects that do not exist in the old schema as “obsolete”.

I’ve come up with a query that allows me to do some logic on specific subjects, 
but I need then to parameterize the copy of data.We’d prefer to do this in 
Virtuoso/PL, but I’ve not yet figured out how to do something like this:

CREATE PROCEDURE test_insert(in source_graph varchar, in target_graph varchar, 
in subject_uri varchar) {
  DECLARE target_iid iri_id;
  DECLARE subject_iid iri_id;

  target_iid := rdf_make_iid_of_qname(target_graph);
  subject_iid := rdf_make_iid_of_qname(subject_uri);

  DELETE FROM RDF_QUAD WHERE g = target_iid AND s = subject_iid;
  SPARQL INSERT { GRAPH target_graph { uri ?p ?o } } USING source_graph WHERE { 
uri ?p ?o };
}

Any help would be appreciated.

Thanks,

Dan Davis, Systems/Applications Architect (Contractor),
Office of Computer and Communications Systems,
National Library of Medicine, NIH

--
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users

--
___
Virtuoso-users mailing list
Virtuoso-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/virtuoso-users


Re: [Virtuoso-users] problems with HTTP SPARQL QUERIES

2015-09-08 Thread Nuria Queralt Rosinach

Hi Hugh,


On 08/29/2015 12:29 AM, Hugh Williams wrote:

Hi Núria,

So you increased from 9000 to 900 , which is excessive considering 
the query takes 144secs to complete ?


well, this is the computer time, my crono said 2'25''


Can you provide the query being executed as well as the query profile 
by running “set profile on;” from isql before running the query.


The query is:

SELECT count(DISTINCT ?gene) as ?genes ?disease ?diseaseName ?orphanet 
count(DISTINCT ?phenotype) as ?phenotypes FROM  
WHERE {

?gda sio:SIO_000628 ?disease,?gene .
?disease skos:exactMatch ?orphanet .
?orphanet sio:SIO_000341 ?phenotype .
FILTER regex(?gene, 'ncbigene')
FILTER regex(?disease, 'umls/id')
?disease dcterms:title ?diseaseName .
FILTER regex(?orphanet, 'identifiers.org/orphanet/86893')
?orphanet dcterms:title ?orphanetName .
?phenotype dcterms:title ?phenotypeName
}
GROUP BY ?disease ?diseaseName ?orphanet


After running "set profile on;" :

SQL> set profile on;
SQL> sparql SELECT count(DISTINCT ?gene) as ?genes ?disease ?diseaseName 
?orphanet count(DISTINCT ?phenotype) as ?phenotypes FROM 
 WHERE {

?gda sio:SIO_000628 ?disease,?gene .
?disease skos:exactMatch ?orphanet .
?orphanet sio:SIO_000341 ?phenotype .
FILTER regex(?gene, 'ncbigene')
FILTER regex(?disease, 'umls/id')
?disease dcterms:title ?diseaseName .
FILTER regex(?orphanet, 'identifiers.org/orphanet/86893')
?orphanet dcterms:title ?orphanetName .
?phenotype dcterms:title ?phenotypeName
}
GROUP BY ?disease ?diseaseName ?orphanet

Type the rest of statement, end with a semicolon (;)> Type the rest of 
statement, end with a semicolon (;)> Type the rest of statement, end 
with a semicolon (;)> Type the rest of statement, end with a semicolon 
(;)> Type the rest of statement, end with a semicolon (;)> Type the rest 
of statement, end with a semicolon (;)> Type the rest of statement, end 
with a semicolon (;)> Type the rest of statement, end with a semicolon 
(;)> Type the rest of statement, end with a semicolon (;)> Type the rest 
of statement, end with a semicolon (;)> Type the rest of statement, end 
with a semicolon (;)> Type the rest of statement, end with a semicolon 
(;)> Type the rest of statement, end with a semicolon (;)> ;

result
LONG VARCHAR
___

12http://linkedlifedata.com/resource/umls/id/C1334968Nodular 
Lymphocyte Predominant Hodgkin Lymphoma 
http://identifiers.org/orphanet/8689311
1http://linkedlifedata.com/resource/umls/id/C2239290Hodgkin 
lymphoma, nodular lymphocyte predominance 
http://identifiers.org/orphanet/8689311


{
time 4e-06% fanout 1 input 1 rows
Subquery 27
{
time   2.9e-06% fanout 1 input 1 rows
{ fork
time  0.14% fanout 2.03747e+06 input 1 rows
RDF_QUAD   2.8e+05 rows(s_14_7_t0.O, s_14_7_t0.S)
 inlined  P =  #/SIO_000628  G =  #/rdf.disgenet.org
time   6.8% fanout   0.5 input 2.03747e+06 rows
END Node
After test:
  0: __ro2sq := Call __ro2sq (s_14_7_t0.O)
  5: _cvt := Call _cvt (, __ro2sq)
  10: if (_cvt  LIKE  ) then 14 else 15 unkn 15
  14: BReturn 1
  15: BReturn 0
time   2.3% fanout 2 input 1.01874e+06 rows

Precode:
  0: __ro2sq := Call __ro2sq (s_14_7_t0.O)
  5: BReturn 0
RDF_QUAD   3.5 rows(s_14_7_t1.O)
 inlined  P =  #/SIO_000628  ,  S = k_s_14_7_t0.S G = #/rdf.disgenet.org
time   6.7% fanout   0.5 input 2.03747e+06 rows
END Node
After test:
  0: __ro2sq := Call __ro2sq (s_14_7_t1.O)
  5: _cvt := Call _cvt (, __ro2sq)
  10: if (_cvt  LIKE  ) then 14 else 15 unkn 15
  14: BReturn 1
  15: BReturn 0
time 1% fanout 1 input 1.01874e+06 rows
RDF_QUAD 5 rows(s_14_7_t4.S, s_14_7_t4.O)
 inlined  P =  #/title  ,  S = k_s_14_7_t0.O G =  #/rdf.disgenet.org
time   4.5% fanout   14.4808 input 1.01874e+06 rows

Precode:
  0: __ro2sq := Call __ro2sq (s_14_7_t4.O)
  5: BReturn 0
RDF_QUAD   4.6 rows(s_14_7_t2.O)
 inlined  P =  ##exactMatch  ,  S = k_s_14_7_t0.O G = #/rdf.disgenet.org
time79% fanout 8.81231e-07 input 1.47521e+07 rows
END Node
After test:
  0: __ro2sq := Call __ro2sq (s_14_7_t2.O)
  5: rdf_regex_impl := Call rdf_regex_impl (__ro2sq, identifiers.org/orphanet/86893>)

  10: if ( 0  = rdf_regex_impl) then 15 else 14 unkn 15
  14: BReturn 1
  15: BReturn 0
time0.0006% fanout11 input13 rows

Precode:
  0: __ro2sq := Call __ro2sq (s_14_7_t2.O)
  5: BReturn 0
RDF_QUAD86 rows(s_14_7_t3.O, s_14_7_t3.S)
 inlined  P =  #/SIO_000341  ,  S = k_s_14_7_t2.O G = #/rdf.disgenet.org
time   0.00054% fanout 1 input   143 rows
RDF_QUAD 5 rows()
 inlined  P =  #/title  ,  S = cast G =  #/rdf.disgenet.org
time   0.00021% fanout 2 input   143 rows
RDF_QUAD 5 rows()
 inlined  P =  #/title  ,  S = k_s_14_7_t2.O G =  #/rdf.d

Re: [Virtuoso-users] problems with HTTP SPARQL QUERIES

2015-09-08 Thread Hugh Williams
Hi Núria,

So you increased from 9000 to 900 , which is excessive considering the 
query takes 144secs to complete ?

Can you provide the query being executed as well as the query profile by 
running “set profile on;” from isql before running the query.

What is the current triple count on the server, which can be obtained with:

sparql select count(*) where {?s ?p ?o};

Also what is the status of the server after running the query multiple times, 
which can be obtained with the command:

status();

Best Regards
Hugh Williams
Professional Services
OpenLink Software, Inc.  //  http://www.openlinksw.com/
Weblog   -- http://www.openlinksw.com/blogs/
LinkedIn -- http://www.linkedin.com/company/openlink-software/
Twitter  -- http://twitter.com/OpenLink
Google+  -- http://plus.google.com/100570109519069333827/
Facebook -- http://www.facebook.com/OpenLinkSoftware
Universal Data Access, Integration, and Management Technology Providers

> On 28 Aug 2015, at 18:08, Nuria Queralt Rosinach  wrote:
> 
> Hi Hugh,
> 
> 
> On 08/28/2015 06:46 PM, Hugh Williams wrote:
>> Hi Núria,
>> 
>> What was the 'MaxQueryCostEstimationTime’ parameter set to previously and 
>> what did you increase it to , as the “ERR_CONTENT_DECODING_FAILED” error 
>> seem odd for a timeout parameter ?
> 
> I increased from 9x10**3 to 9x10**6
> 
> I got directly the virtuoso error message executing the query from our 
> endpoint but specifying the virtuoso port in the browser, in order to avoid 
> the apache server. then the message error from virtuoso was that the 
> estimation execution time was too short. the error message 
> "ERR_CONTENT_DECODING_FAILED" come from apache i guess, as it does not know 
> how to serve the error message from virtuoso?
> 
>> 
>> Also, when you ran the query from isql how long does it take to execute and 
>> return results ?
> 
> 144552 msec
> 
> best,
> n
>> 
>> Best Regards
>> Hugh Williams
>> Professional Services
>> OpenLink Software, Inc.  //  http://www.openlinksw.com/ 
>> Weblog   -- http://www.openlinksw.com/blogs/ 
>> LinkedIn -- 
>> http://www.linkedin.com/company/openlink-software/ 
>> Twitter  -- 
>> http://twitter.com/OpenLink Google+  -- 
>> http://plus.google.com/100570109519069333827/ 
>> Facebook -- 
>> http://www.facebook.com/OpenLinkSoftware 
>> 
>> Universal Data Access, Integration, and Management Technology Providers
>> 
>>> On 28 Aug 2015, at 15:51, Nuria Queralt Rosinach >> > wrote:
>>> 
>>> Hi Hugh,
>>> 
>>> Problem solved! just increasing a bit the ' MaxQueryCostEstimationTime' 
>>> parameter in the configuration of the SPARQL service and the query works 
>>> perfectly fine :)
>>> 
>>> Thank you very much for your always fast replies.
>>> Best,
>>> Núria
>>> 
>>> On 08/28/2015 04:30 PM, Nuria Queralt Rosinach wrote:
 Hi Hugh,
 
 
 On 08/28/2015 02:56 PM, Hugh Williams wrote:
> HI Núria,
> 
> You reported the same error running a SPARQL-FED query last year, was 
> this resolved then as it is unclear from the thread ?
 
 Good memory! i managed to solve the problem in that case. This time it is 
 not a FED.
> What is the query currently being run is it a SPARQL-FED query also or a 
> query against the local instance ?
> 
 
 it is about a query against local data. Issues raised via the sparql 
 endpoint when using DISTINCT in a SELECT query, or GROUP BY modifier: the 
 same query gives output without using DISTINCT or GROUP BY in the SELECT 
 query.
 
> If the query runs from isql which executes queries as the “dba” (or 
> whatever user you login as) and fails via the HTTP , which I assume is 
> the /sparql endpoint, which runs as user “SPARQL”,  
 
 yes
> then most probably the roles assigned to both differ, thus you should 
> check was is assigned to both in the “System Admin -> User Accounts” 
> section of the Conductor and ensure the same SPARQL roles are assigned ie 
>  SPARQL_SELECT, SPARQL_UPDATE, SPARQL_SPONGE, SPARQL_LOAD_SERVICE_DATA , 
> see:
> 
>  
> http://docs.openlinksw.com/virtuoso/rdfsparql.html#rdfsupportedprotocolendpointuri
>  
> 
>   
> http://virtuoso.openlinksw.com/dataspace/dav/wiki/Main/VirtTipsAndTricksDiscoverSPARQFedCapabilities
>  
> 
 I checked, they differ: SPARQL user has the 'SPARQL_SELECT' role assigned, 
 whereas the dba user does not have any role assigned...
 
 Thanks!
 Núria
> 
> Best Regards
>>