[jira] [Resolved] (JENA-1191) Enhance sdbload to cover quad formats, trigger the bulk loader, and print progress.

2016-06-10 Thread Andy Seaborne (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-1191?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne resolved JENA-1191.
-
Resolution: Fixed

> Enhance sdbload to cover quad formats, trigger the bulk loader, and print 
> progress.
> ---
>
> Key: JENA-1191
> URL: https://issues.apache.org/jira/browse/JENA-1191
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: SDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Fix For: Jena 3.1.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1193) sdbquery: FILTER within FILTER NOT EXIST has no effect

2016-06-10 Thread Osma Suominen (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324474#comment-15324474
 ] 

Osma Suominen commented on JENA-1193:
-

Result for SDB 3.1.0:
{noformat}
PREFIX  skos: 
PREFIX  rdfs: 
PREFIX  ex:   

SELECT  *
WHERE
  { GRAPH ex:src
  { ?c1  rdfs:label  ?label }
FILTER NOT EXISTS { GRAPH ex:dst
  { ?c2  ?anyprop  ?label
FILTER ( ?anyprop != skos:prefLabel )
  }
  }
  }
- - - - - - - - - - - - - -
(prefix ((rdfs: ))
  (filter (notexists
 (filter (!= ?anyprop 
)
   (SQL '''SqlSelectBlock/Q_2
 Q_2.g = -273327510643043486
   Table Q_2 -- ex:dst ?c2 ?anyprop ?label''')
 ))
(SQL '''SqlSelectBlock/S_1   -- V_1=?c1 V_2=?label
  R_1.lex/V_1_lex R_1.datatype/V_1_datatype R_1.lang/V_1_lang 
R_1.type/V_1_type 
  R_2.lex/V_2_lex R_2.datatype/V_2_datatype R_2.lang/V_2_lang 
R_2.type/V_2_type
Join/left outer
  Join/left outer
SqlSelectBlock/Q_1   -- ?c1:(Q_1.s=>Q_1.X_1) 
?label:(Q_1.o=>Q_1.X_2)
Q_1.s/X_1 Q_1.o/X_2
Q_1.g = -317857793313676831
Q_1.p = 6454844767405606854
  Table Q_1  -- ex:src ?c1 rdfs:label ?label
Table R_1-- Var: ?c1
Condition Q_1.X_1 = R_1.hash
  Table R_2  -- Var: ?label
  Condition Q_1.X_2 = R_2.hash''')
  ))
SELECT   -- V_1=?c1 V_2=?label
  R_1.lex AS V_1_lex, R_1.datatype AS V_1_datatype, R_1.lang AS V_1_lang, 
R_1.type AS V_1_type, 
  R_2.lex AS V_2_lex, R_2.datatype AS V_2_datatype, R_2.lang AS V_2_lang, 
R_2.type AS V_2_type
FROM
( SELECT -- ?c1:(Q_1.s=>Q_1.X_1) 
?label:(Q_1.o=>Q_1.X_2)
Q_1.s AS X_1, Q_1.o AS X_2
  FROM Quads AS Q_1  -- ex:src ?c1 rdfs:label ?label
  WHERE ( Q_1.g = -317857793313676831 -- Const: ex:src
 AND Q_1.p = 6454844767405606854 -- Const: rdfs:label
 )
) AS Q_1 -- ?c1:(Q_1.s=>Q_1.X_1) 
?label:(Q_1.o=>Q_1.X_2)
  LEFT OUTER JOIN
Nodes AS R_1 -- Var: ?c1
  ON ( Q_1.X_1 = R_1.hash )
  LEFT OUTER JOIN
Nodes AS R_2 -- Var: ?label
  ON ( Q_1.X_2 = R_2.hash )

SELECT   -- ?anyprop:(Q_3.p=>Q_3.X_1) 
?c2:(Q_3.s=>Q_3.X_2)
  Q_3.p AS X_1, Q_3.s AS X_2
FROM Quads AS Q_3-- ex:dst ?c2 ?anyprop "label1"
WHERE ( Q_3.g = -273327510643043486  -- Const: ex:dst
   AND Q_3.o = -9201284561348719236  -- Const: "label1"
   )

SELECT   -- ?anyprop:(Q_4.p=>Q_4.X_1) 
?c2:(Q_4.s=>Q_4.X_2)
  Q_4.p AS X_1, Q_4.s AS X_2
FROM Quads AS Q_4-- ex:dst ?c2 ?anyprop "label2"
WHERE ( Q_4.g = -273327510643043486  -- Const: ex:dst
   AND Q_4.o = 2153590109465208943   -- Const: "label2"
   )

--
| c1  | label|
==
| ex:src1 | "label1" |
| ex:src2 | "label2" |
--
{noformat}

Result for SDB 3.0.1:
{noformat}
PREFIX  skos: 
PREFIX  rdfs: 
PREFIX  ex:   

SELECT  *
WHERE
  { GRAPH ex:src
  { ?c1  rdfs:label  ?label }
FILTER NOT EXISTS { GRAPH ex:dst
  { ?c2  ?anyprop  ?label
FILTER ( ?anyprop != skos:prefLabel )
  }
  }
  }
- - - - - - - - - - - - - -
(filter (notexists
   (filter (!= ?anyprop )
 (SQL '''SqlSelectBlock/Q_2
   Q_2.g = -273327510643043486
 Table Q_2   -- ex:dst ?c2 ?anyprop ?label''')
   ))
  (SQL '''SqlSelectBlock/S_1 -- V_1=?c1 V_2=?label
R_1.lex/V_1_lex R_1.datatype/V_1_datatype R_1.lang/V_1_lang 
R_1.type/V_1_type 
R_2.lex/V_2_lex R_2.datatype/V_2_datatype R_2.lang/V_2_lang 
R_2.type/V_2_type
  Join/left outer
Join/left outer
  SqlSelectBlock/Q_1 -- ?label:(Q_1.o=>Q_1.X_1) 
?c1:(Q_1.s=>Q_1.X_2)
  Q_1.o/X_1 Q_1.s/X_2
  Q_1.g = -317857793313676831
  Q_1.p = 6454844767405606854
Table Q_1-- ex:src ?c1 rdfs:label ?label
  Table R_1  -- Var: ?c1
  Condition Q_1.X_2 = R_1.hash
Table R_2-- Var: ?label
Condition 

[jira] [Commented] (JENA-1191) Enhance sdbload to cover quad formats, trigger the bulk loader, and print progress.

2016-06-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324451#comment-15324451
 ] 

ASF subversion and git services commented on JENA-1191:
---

Commit d4d2dd40b3edccbf9b58f009a4248109f54d9207 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=d4d2dd4 ]

JENA-1191: Refactor


> Enhance sdbload to cover quad formats, trigger the bulk loader, and print 
> progress.
> ---
>
> Key: JENA-1191
> URL: https://issues.apache.org/jira/browse/JENA-1191
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: SDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Fix For: Jena 3.1.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1191) Enhance sdbload to cover quad formats, trigger the bulk loader, and print progress.

2016-06-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1191?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324440#comment-15324440
 ] 

ASF subversion and git services commented on JENA-1191:
---

Commit 4ef9453ba1beec5fafeee3bb0095f6c7f79039f6 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=4ef9453 ]

JENA-1191: Handle triples arriving via the quads route


> Enhance sdbload to cover quad formats, trigger the bulk loader, and print 
> progress.
> ---
>
> Key: JENA-1191
> URL: https://issues.apache.org/jira/browse/JENA-1191
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: SDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Fix For: Jena 3.1.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Resolved] (JENA-1192) Support the MariaDB JDBC driver

2016-06-10 Thread Andy Seaborne (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-1192?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne resolved JENA-1192.
-
   Resolution: Fixed
Fix Version/s: Jena 3.1.1

> Support the MariaDB JDBC driver
> ---
>
> Key: JENA-1192
> URL: https://issues.apache.org/jira/browse/JENA-1192
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: SDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Fix For: Jena 3.1.1
>
>
> The MariaDB JDBC is compatible with the MySQL JDBC driver. It has different 
> license; the MariaDb JDBC driver is LGPL and the MySQL JDBC driver is GPL 
> with a special FOSS exception.
> In addition, the MariaDB JDBC driver response to "jdbc:mysql:..." URLs.
> Supporting the driver has two parts: 
> When MariaDB is explicitly chosen in "sdb:sdbType", we have a registration 
> for  "MariaDB" to map to "org.mariadb.jdbc.Driver" and ideally build the 
> right JDBC URL for the case when the URL is not explicitly provided.
> The other part is for a setup is for MySQL but only the MariaDB JDBC driver 
> is on the classpath. We can treat this as a special-case during the loading 
> of the JDBC driver so if looking for the MySQL classname 
> ""com.mysql.jdbc.Driver" fails, the code also looks for 
> "org.mariadb.jdbc.Driver".
> At no point is Jena (source or binary) shipping either JDBC driver.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-1192) Support the MariaDB JDBC driver

2016-06-10 Thread ASF subversion and git services (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1192?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324399#comment-15324399
 ] 

ASF subversion and git services commented on JENA-1192:
---

Commit edba13136e2dd201e26e24a62e3f1b8a5c20e81e in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=edba131 ]

JENA-1192: Support for the MariaDB JDBC driver.


> Support the MariaDB JDBC driver
> ---
>
> Key: JENA-1192
> URL: https://issues.apache.org/jira/browse/JENA-1192
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: SDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
>
> The MariaDB JDBC is compatible with the MySQL JDBC driver. It has different 
> license; the MariaDb JDBC driver is LGPL and the MySQL JDBC driver is GPL 
> with a special FOSS exception.
> In addition, the MariaDB JDBC driver response to "jdbc:mysql:..." URLs.
> Supporting the driver has two parts: 
> When MariaDB is explicitly chosen in "sdb:sdbType", we have a registration 
> for  "MariaDB" to map to "org.mariadb.jdbc.Driver" and ideally build the 
> right JDBC URL for the case when the URL is not explicitly provided.
> The other part is for a setup is for MySQL but only the MariaDB JDBC driver 
> is on the classpath. We can treat this as a special-case during the loading 
> of the JDBC driver so if looking for the MySQL classname 
> ""com.mysql.jdbc.Driver" fails, the code also looks for 
> "org.mariadb.jdbc.Driver".
> At no point is Jena (source or binary) shipping either JDBC driver.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (JENA-508) Add support for XPath 3 Functions

2016-06-10 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324401#comment-15324401
 ] 

ASF GitHub Bot commented on JENA-508:
-

Github user asfgit closed the pull request at:

https://github.com/apache/jena/pull/148


> Add support for XPath 3 Functions
> -
>
> Key: JENA-508
> URL: https://issues.apache.org/jira/browse/JENA-508
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ
>Reporter: Rob Vesse
>Assignee: Alessandro Seganti
>  Labels: gsoc, gsoc2015
>
> XPath 3 is now a Candidate Recommendation - 
> http://www.w3.org/TR/xpath-functions-30/
> It contains many new functions and operators (particularly in the 
> mathematical space) which we should consider adding into future versions of 
> ARQ.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] jena pull request #148: JENA-508: implemented fn:adjust-datetime-to-timezone...

2016-06-10 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/jena/pull/148


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (JENA-1193) sdbquery: FILTER within FILTER NOT EXIST has no effect

2016-06-10 Thread Andy Seaborne (JIRA)

[ 
https://issues.apache.org/jira/browse/JENA-1193?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=15324386#comment-15324386
 ] 

Andy Seaborne commented on JENA-1193:
-

Could you please check earlier versions, 3.0.0 to 3.1.0?


> sdbquery: FILTER within FILTER NOT EXIST has no effect
> --
>
> Key: JENA-1193
> URL: https://issues.apache.org/jira/browse/JENA-1193
> Project: Apache Jena
>  Issue Type: Bug
>  Components: SDB
>Affects Versions: Jena 3.1.0
>Reporter: Osma Suominen
>
> I noticed that when run within sdbquery, a SPARQL query containing a nested 
> FILTER NOT EXISTS { ... FILTER (...) } doesn't work the same way as when run 
> on an in-memory model with the same data. 
> Here's my data as TriG:
> {noformat}
> @prefix skos: .
> @prefix rdfs: .
> @prefix ex: .
> # source graph
> ex:src {
> ex:src1 rdfs:label "label1" .
> ex:src2 rdfs:label "label2" .
> }
> # destination graph
> ex:dst {
> ex:dst1 skos:prefLabel "label1" .
> ex:dst2 skos:altLabel "label2" .
> }
> {noformat}
> Here's my query:
> {noformat}
> PREFIX rdfs: 
> PREFIX skos: 
> PREFIX ex: 
> SELECT * {
> GRAPH ex:src {
> ?c1 rdfs:label ?label .
> }
> FILTER NOT EXISTS {
> GRAPH ex:dst {
> ?c2 ?anyprop ?label .
> FILTER (?anyprop != skos:prefLabel)
> }
> }
> }
> {noformat}
> Results when run with Jena "sparql" command line tool on an in-memory model:
> {noformat}
> --
> | c1  | label|
> ==
> | ex:src1 | "label1" |
> --
> {noformat}
> Results when run with sdbquery --debug option:
> {noformat}
> PREFIX  skos: 
> PREFIX  rdfs: 
> PREFIX  ex:   
> SELECT  *
> WHERE
>   { GRAPH ex:src
>   { ?c1  rdfs:label  ?label }
> FILTER NOT EXISTS { GRAPH ex:dst
>   { ?c2  ?anyprop  ?label
> FILTER ( ?anyprop != skos:prefLabel )
>   }
>   }
>   }
> - - - - - - - - - - - - - -
> (prefix ((rdfs: ))
>   (filter (notexists
>  (filter (!= ?anyprop 
> )
>(SQL '''SqlSelectBlock/Q_1
>  Q_1.g = -273327510643043486
>Table Q_1 -- ex:dst ?c2 ?anyprop ?label''')
>  ))
> (SQL '''SqlSelectBlock/S_1   -- V_1=?c1 V_2=?label
>   R_1.lex/V_1_lex R_1.datatype/V_1_datatype R_1.lang/V_1_lang 
> R_1.type/V_1_type 
>   R_2.lex/V_2_lex R_2.datatype/V_2_datatype R_2.lang/V_2_lang 
> R_2.type/V_2_type
> Join/left outer
>   Join/left outer
> SqlSelectBlock/Q_2   -- ?c1:(Q_2.s=>Q_2.X_1) 
> ?label:(Q_2.o=>Q_2.X_2)
> Q_2.s/X_1 Q_2.o/X_2
> Q_2.g = -317857793313676831
> Q_2.p = 6454844767405606854
>   Table Q_2  -- ex:src ?c1 rdfs:label ?label
> Table R_1-- Var: ?c1
> Condition Q_2.X_1 = R_1.hash
>   Table R_2  -- Var: ?label
>   Condition Q_2.X_2 = R_2.hash''')
>   ))
> SELECT   -- V_1=?c1 V_2=?label
>   R_1.lex AS V_1_lex, R_1.datatype AS V_1_datatype, R_1.lang AS V_1_lang, 
> R_1.type AS V_1_type, 
>   R_2.lex AS V_2_lex, R_2.datatype AS V_2_datatype, R_2.lang AS V_2_lang, 
> R_2.type AS V_2_type
> FROM
> ( SELECT -- ?c1:(Q_2.s=>Q_2.X_1) 
> ?label:(Q_2.o=>Q_2.X_2)
> Q_2.s AS X_1, Q_2.o AS X_2
>   FROM Quads AS Q_2  -- ex:src ?c1 rdfs:label ?label
>   WHERE ( Q_2.g = -317857793313676831 -- Const: ex:src
>  AND Q_2.p = 6454844767405606854 -- Const: rdfs:label
>  )
> ) AS Q_2 -- ?c1:(Q_2.s=>Q_2.X_1) 
> ?label:(Q_2.o=>Q_2.X_2)
>   LEFT OUTER JOIN
> Nodes AS R_1 -- Var: ?c1
>   ON ( Q_2.X_1 = R_1.hash )
>   LEFT OUTER JOIN
> Nodes AS R_2 -- Var: ?label
>   ON ( Q_2.X_2 = R_2.hash )
> SELECT   -- ?c2:(Q_3.s=>Q_3.X_1) 
> ?anyprop:(Q_3.p=>Q_3.X_2)
>   Q_3.s AS X_1, Q_3.p AS X_2
> FROM Quads AS Q_3-- ex:dst ?c2 ?anyprop "label1"
> WHERE ( Q_3.g = -273327510643043486  -- Const: ex:dst
>AND Q_3.o = -9201284561348719236  -- Const: "label1"
> 

[jira] [Reopened] (JENA-1191) Enhance sdbload to cover quad formats, trigger the bulk loader, and print progress.

2016-06-10 Thread Osma Suominen (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-1191?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Osma Suominen reopened JENA-1191:
-

I noticed while investigating JENA-1193 that sdbload gives a 
NullPointerException when given a TriG file that includes a default graph, e.g. 
this one:

{noformat}
@prefix ex: .

{
ex:s ex:p ex:o .
}
{noformat}

Result:
{noformat}
ERROR Error in thread: null
java.lang.NullPointerException
at 
org.apache.jena.sdb.layout2.NodeLayout2.nodeToLex(NodeLayout2.java:40)
at 
org.apache.jena.sdb.layout2.TupleLoaderBase$PreparedNode.(TupleLoaderBase.java:426)
at 
org.apache.jena.sdb.layout2.TupleLoaderBase.load(TupleLoaderBase.java:93)
at 
org.apache.jena.sdb.layout2.LoaderTuplesNodes.updateOneTuple(LoaderTuplesNodes.java:298)
at 
org.apache.jena.sdb.layout2.LoaderTuplesNodes.access$200(LoaderTuplesNodes.java:42)
at 
org.apache.jena.sdb.layout2.LoaderTuplesNodes$Commiter.run(LoaderTuplesNodes.java:361)
at java.lang.Thread.run(Thread.java:745)
java.lang.NullPointerException
at 
org.apache.jena.sdb.layout2.NodeLayout2.nodeToLex(NodeLayout2.java:40)
at 
org.apache.jena.sdb.layout2.TupleLoaderBase$PreparedNode.(TupleLoaderBase.java:426)
at 
org.apache.jena.sdb.layout2.TupleLoaderBase.load(TupleLoaderBase.java:93)
at 
org.apache.jena.sdb.layout2.LoaderTuplesNodes.updateOneTuple(LoaderTuplesNodes.java:298)
at 
org.apache.jena.sdb.layout2.LoaderTuplesNodes.access$200(LoaderTuplesNodes.java:42)
at 
org.apache.jena.sdb.layout2.LoaderTuplesNodes$Commiter.run(LoaderTuplesNodes.java:361)
at java.lang.Thread.run(Thread.java:745)
{noformat}


> Enhance sdbload to cover quad formats, trigger the bulk loader, and print 
> progress.
> ---
>
> Key: JENA-1191
> URL: https://issues.apache.org/jira/browse/JENA-1191
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: SDB
>Affects Versions: Jena 3.1.0
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Fix For: Jena 3.1.1
>
>




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Updated] (JENA-1193) sdbquery: FILTER within FILTER NOT EXIST has no effect

2016-06-10 Thread Osma Suominen (JIRA)

 [ 
https://issues.apache.org/jira/browse/JENA-1193?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Osma Suominen updated JENA-1193:

Description: 
I noticed that when run within sdbquery, a SPARQL query containing a nested 
FILTER NOT EXISTS { ... FILTER (...) } doesn't work the same way as when run on 
an in-memory model with the same data. 

Here's my data as TriG:

{noformat}
@prefix skos: .
@prefix rdfs: .
@prefix ex: .

# source graph
ex:src {
ex:src1 rdfs:label "label1" .
ex:src2 rdfs:label "label2" .
}

# destination graph
ex:dst {
ex:dst1 skos:prefLabel "label1" .
ex:dst2 skos:altLabel "label2" .
}
{noformat}

Here's my query:
{noformat}
PREFIX rdfs: 
PREFIX skos: 
PREFIX ex: 

SELECT * {
GRAPH ex:src {
?c1 rdfs:label ?label .
}

FILTER NOT EXISTS {
GRAPH ex:dst {
?c2 ?anyprop ?label .
FILTER (?anyprop != skos:prefLabel)
}
}
}
{noformat}

Results when run with Jena "sparql" command line tool on an in-memory model:
{noformat}
--
| c1  | label|
==
| ex:src1 | "label1" |
--
{noformat}

Results when run with sdbquery --debug option:
{noformat}
PREFIX  skos: 
PREFIX  rdfs: 
PREFIX  ex:   

SELECT  *
WHERE
  { GRAPH ex:src
  { ?c1  rdfs:label  ?label }
FILTER NOT EXISTS { GRAPH ex:dst
  { ?c2  ?anyprop  ?label
FILTER ( ?anyprop != skos:prefLabel )
  }
  }
  }
- - - - - - - - - - - - - -
(prefix ((rdfs: ))
  (filter (notexists
 (filter (!= ?anyprop 
)
   (SQL '''SqlSelectBlock/Q_1
 Q_1.g = -273327510643043486
   Table Q_1 -- ex:dst ?c2 ?anyprop ?label''')
 ))
(SQL '''SqlSelectBlock/S_1   -- V_1=?c1 V_2=?label
  R_1.lex/V_1_lex R_1.datatype/V_1_datatype R_1.lang/V_1_lang 
R_1.type/V_1_type 
  R_2.lex/V_2_lex R_2.datatype/V_2_datatype R_2.lang/V_2_lang 
R_2.type/V_2_type
Join/left outer
  Join/left outer
SqlSelectBlock/Q_2   -- ?c1:(Q_2.s=>Q_2.X_1) 
?label:(Q_2.o=>Q_2.X_2)
Q_2.s/X_1 Q_2.o/X_2
Q_2.g = -317857793313676831
Q_2.p = 6454844767405606854
  Table Q_2  -- ex:src ?c1 rdfs:label ?label
Table R_1-- Var: ?c1
Condition Q_2.X_1 = R_1.hash
  Table R_2  -- Var: ?label
  Condition Q_2.X_2 = R_2.hash''')
  ))
SELECT   -- V_1=?c1 V_2=?label
  R_1.lex AS V_1_lex, R_1.datatype AS V_1_datatype, R_1.lang AS V_1_lang, 
R_1.type AS V_1_type, 
  R_2.lex AS V_2_lex, R_2.datatype AS V_2_datatype, R_2.lang AS V_2_lang, 
R_2.type AS V_2_type
FROM
( SELECT -- ?c1:(Q_2.s=>Q_2.X_1) 
?label:(Q_2.o=>Q_2.X_2)
Q_2.s AS X_1, Q_2.o AS X_2
  FROM Quads AS Q_2  -- ex:src ?c1 rdfs:label ?label
  WHERE ( Q_2.g = -317857793313676831 -- Const: ex:src
 AND Q_2.p = 6454844767405606854 -- Const: rdfs:label
 )
) AS Q_2 -- ?c1:(Q_2.s=>Q_2.X_1) 
?label:(Q_2.o=>Q_2.X_2)
  LEFT OUTER JOIN
Nodes AS R_1 -- Var: ?c1
  ON ( Q_2.X_1 = R_1.hash )
  LEFT OUTER JOIN
Nodes AS R_2 -- Var: ?label
  ON ( Q_2.X_2 = R_2.hash )

SELECT   -- ?c2:(Q_3.s=>Q_3.X_1) 
?anyprop:(Q_3.p=>Q_3.X_2)
  Q_3.s AS X_1, Q_3.p AS X_2
FROM Quads AS Q_3-- ex:dst ?c2 ?anyprop "label1"
WHERE ( Q_3.g = -273327510643043486  -- Const: ex:dst
   AND Q_3.o = -9201284561348719236  -- Const: "label1"
   )

SELECT   -- ?c2:(Q_4.s=>Q_4.X_1) 
?anyprop:(Q_4.p=>Q_4.X_2)
  Q_4.s AS X_1, Q_4.p AS X_2
FROM Quads AS Q_4-- ex:dst ?c2 ?anyprop "label2"
WHERE ( Q_4.g = -273327510643043486  -- Const: ex:dst
   AND Q_4.o = 2153590109465208943   -- Const: "label2"
   )

--
| c1  | label|
==
| ex:src1 | "label1" |
| ex:src2 | "label2" |
--
{noformat}

Note the extra result row. It seems that the inner FILTER has no effect.

The issue seems similar to JENA-1128. I'm using the current (2016-06-10) 
3.1.1-SNAPSHOT version.

  was:
I noticed that when run 

[jira] [Created] (JENA-1193) sdbquery: FILTER within FILTER NOT EXIST has no effect

2016-06-10 Thread Osma Suominen (JIRA)
Osma Suominen created JENA-1193:
---

 Summary: sdbquery: FILTER within FILTER NOT EXIST has no effect
 Key: JENA-1193
 URL: https://issues.apache.org/jira/browse/JENA-1193
 Project: Apache Jena
  Issue Type: Bug
  Components: SDB
Affects Versions: Jena 3.1.0
Reporter: Osma Suominen


I noticed that when run within sdbquery, a SPARQL query containing a nested 
FILTER NOT EXISTS { ... FILTER (...) } doesn't work the same way as when run on 
an in-memory model with the same data. 

Here's my data as TriG:

{noformat}
@prefix skos: .
@prefix rdfs: .
@prefix ex: .

# source graph
ex:src {
ex:src1 rdfs:label "label1" .
ex:src2 rdfs:label "label2" .
}

# destination graph
ex:dst {
ex:dst1 skos:prefLabel "label1" .
ex:dst2 skos:altLabel "label2" .
}
{noformat}

Here's my query:
{noformat}
PREFIX rdfs: 
PREFIX skos: 
PREFIX ex: 

SELECT * {
GRAPH ex:src {
?c1 rdfs:label ?label .
}

FILTER NOT EXISTS {
GRAPH ex:dst {
?c2 ?anyprop ?label .
FILTER (?anyprop != skos:prefLabel)
}
}
}
{noformat}

Results when run with Jena "sparql" command line tool on an in-memory model:
{noformat}
--
| c1  | label|
==
| ex:src1 | "label1" |
--
{noformat}

Results when run with sdbquery --debug option:
{noformat}
PREFIX  skos: 
PREFIX  rdfs: 
PREFIX  ex:   

SELECT  *
WHERE
  { GRAPH ex:src
  { ?c1  rdfs:label  ?label }
FILTER NOT EXISTS { GRAPH ex:dst
  { ?c2  ?anyprop  ?label
FILTER ( ?anyprop != skos:prefLabel )
  }
  }
  }
- - - - - - - - - - - - - -
(prefix ((rdfs: ))
  (filter (notexists
 (filter (!= ?anyprop 
)
   (SQL '''SqlSelectBlock/Q_1
 Q_1.g = -273327510643043486
   Table Q_1 -- ex:dst ?c2 ?anyprop ?label''')
 ))
(SQL '''SqlSelectBlock/S_1   -- V_1=?c1 V_2=?label
  R_1.lex/V_1_lex R_1.datatype/V_1_datatype R_1.lang/V_1_lang 
R_1.type/V_1_type 
  R_2.lex/V_2_lex R_2.datatype/V_2_datatype R_2.lang/V_2_lang 
R_2.type/V_2_type
Join/left outer
  Join/left outer
SqlSelectBlock/Q_2   -- ?c1:(Q_2.s=>Q_2.X_1) 
?label:(Q_2.o=>Q_2.X_2)
Q_2.s/X_1 Q_2.o/X_2
Q_2.g = -317857793313676831
Q_2.p = 6454844767405606854
  Table Q_2  -- ex:src ?c1 rdfs:label ?label
Table R_1-- Var: ?c1
Condition Q_2.X_1 = R_1.hash
  Table R_2  -- Var: ?label
  Condition Q_2.X_2 = R_2.hash''')
  ))
SELECT   -- V_1=?c1 V_2=?label
  R_1.lex AS V_1_lex, R_1.datatype AS V_1_datatype, R_1.lang AS V_1_lang, 
R_1.type AS V_1_type, 
  R_2.lex AS V_2_lex, R_2.datatype AS V_2_datatype, R_2.lang AS V_2_lang, 
R_2.type AS V_2_type
FROM
( SELECT -- ?c1:(Q_2.s=>Q_2.X_1) 
?label:(Q_2.o=>Q_2.X_2)
Q_2.s AS X_1, Q_2.o AS X_2
  FROM Quads AS Q_2  -- ex:src ?c1 rdfs:label ?label
  WHERE ( Q_2.g = -317857793313676831 -- Const: ex:src
 AND Q_2.p = 6454844767405606854 -- Const: rdfs:label
 )
) AS Q_2 -- ?c1:(Q_2.s=>Q_2.X_1) 
?label:(Q_2.o=>Q_2.X_2)
  LEFT OUTER JOIN
Nodes AS R_1 -- Var: ?c1
  ON ( Q_2.X_1 = R_1.hash )
  LEFT OUTER JOIN
Nodes AS R_2 -- Var: ?label
  ON ( Q_2.X_2 = R_2.hash )

SELECT   -- ?c2:(Q_3.s=>Q_3.X_1) 
?anyprop:(Q_3.p=>Q_3.X_2)
  Q_3.s AS X_1, Q_3.p AS X_2
FROM Quads AS Q_3-- ex:dst ?c2 ?anyprop "label1"
WHERE ( Q_3.g = -273327510643043486  -- Const: ex:dst
   AND Q_3.o = -9201284561348719236  -- Const: "label1"
   )

SELECT   -- ?c2:(Q_4.s=>Q_4.X_1) 
?anyprop:(Q_4.p=>Q_4.X_2)
  Q_4.s AS X_1, Q_4.p AS X_2
FROM Quads AS Q_4-- ex:dst ?c2 ?anyprop "label2"
WHERE ( Q_4.g = -273327510643043486  -- Const: ex:dst
   AND Q_4.o = 2153590109465208943   -- Const: "label2"
   )

--
| c1  | label|
==
| ex:src1 | "label1" |
| ex:src2 | "label2" |
--
{noformat}

Note the