Re: svn commit: r1545008 - in /jena/trunk/jena-arq/src: main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformF

2013-11-24 Thread Claude Warren
Andy,

My test with the bound was removed and I don't see one with the bound
included.  I think the bound was what triggered the issue in the case I was
attempting to fix, because the bound creates a new triple block.

Do you think this is not important to test or am I missing a test that
applies in this case?

Claude


On Sun, Nov 24, 2013 at 4:27 PM,  wrote:

> Author: andy
> Date: Sun Nov 24 16:27:13 2013
> New Revision: 1545008
>
> URL: http://svn.apache.org/r1545008
> Log:
> More general fix for JENA-595.
>
> Modified:
>
> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
>
> jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformFilterPlacement.java
>
> Modified:
> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
> URL:
> http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java?rev=1545008&r1=1545007&r2=1545008&view=diff
>
> ==
> ---
> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
> (original)
> +++
> jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
> Sun Nov 24 16:27:13 2013
> @@ -426,26 +426,19 @@ public class TransformFilterPlacement ex
>
>  // And try down the expressions
>  Placement p = transform(pushed, opSub) ;
> -
> +
>  if ( p == null ) {
> -Op op1 = OpFilter.filter(pushed, opSub) ;
> -Op op2 = input.copy(op1) ; //, input.getVarExprList()) ;
> //OpExtend.extend(op1, input.getVarExprList()) ;
> -return result(op2, unpushed) ;
> -}
> -// handle the case where the filter is being to a surrounding
> sequence or other bgp container
> -// and may apply to the assignation variables.
> -// in this case disjoint var sets indicate the expression is
> unused.
> -pushed = new ExprList() ;
> -for ( Expr expr : p.unplaced ) {
> -Set exprVars = expr.getVarsMentioned() ;
> -if ( disjoint(vars1, exprVars) )
> -unpushed.add(expr);
> -else
> -pushed.add(expr) ;
> +// Couldn't place an filter expressions.  Do nothing.
> +return null ;
>  }
> -Op op1 = OpFilter.filter(pushed, p.op) ;
> -Op op2 = input.copy(op1) ;
> -return result(op2, unpushed) ;
> +
> +if ( ! p.unplaced.isEmpty() )
> +// Some placed, not all.
> +// Pass back out all untouched expressions.
> +unpushed.addAll(p.unplaced) ;
> +Op op1 = input.copy(p.op) ;
> +
> +return result(op1, unpushed) ;
>  }
>
>  private Placement placeProject(ExprList exprs, OpProject input) {
>
> Modified:
> jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformFilterPlacement.java
> URL:
> http://svn.apache.org/viewvc/jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformFilterPlacement.java?rev=1545008&r1=1545007&r2=1545008&view=diff
>
> ==
> ---
> jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformFilterPlacement.java
> (original)
> +++
> jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformFilterPlacement.java
> Sun Nov 24 16:27:13 2013
> @@ -124,15 +124,6 @@ public class TestTransformFilterPlacemen
>   null) ;
>  }
>
> -@Test public void place_sequence_with_bind() {
> -   test("(filter (= ?foo 1) " +
> -   "(sequence  " +
> -   "(extend " +
> -   "   ((?bound (if ?v_binder 'Y' 'N')))
> " +
> -   "   (bgp (triple ?foob <
> http://example.com/binding> ?v_binder)))" +
> -   "(bgp (triple ?foob <
> http://www.w3.org/2000/01/rdf-schema#label> ?foo", null );
> -}
> -
>  // Join : one sided push.
>  @Test public void place_join_01() {
>  test("(filter (= ?x 123) (join (bgp (?s ?p ?x)) (bgp (?s ?p ?z))
> ))",
> @@ -232,27 +223,49 @@ public class TestTransformFilterPlacemen
>   "(extend ((?z 123)) (filter (= ?x 123) (bgp (?s ?p ?x)) ))")
> ;
>  }
>
> -@Test public void place_extend_02() { // Blocked
> +@Test public void place_extend_02() {
> +test("(filter ((= ?x1 123) (= ?x2 456)) (extend (?z 789) (bgp (?s
> ?p ?x1)) ))",
> + "(filter (= ?x2 456) (extend (?z 789) (filter (= ?x1 123)
> (bgp (?s ?p ?x1)) )))") ;
> +}
> +
> +@Test public void place_extend_03() { // Blocked
>  test("(filter (= ?x 123) (extend ((?x 123)) (bgp (?s ?p ?z))

[jira] [Commented] (JENA-595) Improve filter placement optimization

2013-11-24 Thread Hudson (JIRA)

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

Hudson commented on JENA-595:
-

ABORTED: Integrated in Jena_Development_Test #1050 (See 
[https://builds.apache.org/job/Jena_Development_Test/1050/])
More general fix for JENA-595. (andy: rev 1545008)
* 
/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
* 
/jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformFilterPlacement.java


> Improve filter placement optimization
> -
>
> Key: JENA-595
> URL: https://issues.apache.org/jira/browse/JENA-595
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Attachments: FilterPlacementError.java, JENA-595-FilterPlacement.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.1#6144)


Re: wiki

2013-11-24 Thread Andy Seaborne

On 23/11/13 15:50, Claude Warren wrote:

I asked about the wiki awhile back and can't seem to find that info now.  I
know there are 2 available wikis.   I would like to start a FAQ type page
and perhaps a set of pages for examples.  Does anyone:
1.  know what the wiki URLs are?
2.  have any opinion which we should use?

Claude



Confluence:


https://cwiki.apache.org/confluence/display/JENA/

MoinMoin one http://wiki.apache.org/ (there may be 
https://wiki.apache.org/jena/ -- you need to check)


Confluence is very slow and clunky IMO.

Andy




[jira] [Commented] (JENA-595) Improve filter placement optimization

2013-11-24 Thread Andy Seaborne (JIRA)

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

Andy Seaborne commented on JENA-595:


A way to see the optimizer better is to use {{arq.qparse --print=op --print=opt 
--file query.rq}} This shows the input and output of optimization.  Saves 
having to have data that causes the situation and save having to execute a 
query.

More general fix applied - all unprocessed expressions moved into {{unpushed}}. 
 An intermediate {{(filter)}} directly under {{(extend)}} is never generated.

> Improve filter placement optimization
> -
>
> Key: JENA-595
> URL: https://issues.apache.org/jira/browse/JENA-595
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Attachments: FilterPlacementError.java, JENA-595-FilterPlacement.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (JENA-595) Improve filter placement optimization

2013-11-24 Thread ASF subversion and git services (JIRA)

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

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

Commit 1545008 from [~andy.seaborne] in branch 'jena/trunk'
[ https://svn.apache.org/r1545008 ]

More general fix for JENA-595.

> Improve filter placement optimization
> -
>
> Key: JENA-595
> URL: https://issues.apache.org/jira/browse/JENA-595
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Attachments: FilterPlacementError.java, JENA-595-FilterPlacement.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.1#6144)


Re: Adding individuals to object property. Ontology unusually formatted.

2013-11-24 Thread Nogales Moyano Alberto
Ok, sorry thanks for your help.
Regards.
__

Alberto Nogales Moyano
Information engineering research unit
University of Alcalá


El 24/11/2013, a las 13:42, Dave Reynolds  escribió:

> Hi,
> 
> This is a question for the jena-users list, the dev list is for people 
> developing Jena itself.  However, see below ...
> 
> On 23/11/13 22:44, Nogales Moyano Alberto wrote:
>> Hello I am trying to add an object property between this two individuals. I 
>> also have the object property in the code and the individuals are in the 
>> ontology. In only need to connect them using a property. The individuals 
>> look like this in the code, my problem is that I have never work with that 
>> ontologies using this "Description" tag.
>> 
>> 
>> 
>> http://vivo.iu.edu/individual/n6356";>
>> 
>> 
>> 
>> 
>> 
>> Indiana University Digital Music Library 
>> Project
>> > rdf:datatype="&xsd;dateTime">2010-07-28T15:36:03
>> conference 
>> paper
>> > rdf:datatype="&xsd;string">http://doi.acm.org/10.1145/379437.379774
>> Indiana University Digital Music Library Project
>> http://vivo.iu.edu/individual/n4086167"/>
>> http://vivo.iu.edu/individual/n5092"/>
>> > rdf:resource="http://vivo.iu.edu/individual/n6257"/>
>> > rdf:resource="http://vivo.iu.edu/individual/n6300"/>
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> http://vivo.iu.edu/individual/n6399";>
>> 
>> 
>> 
>> 
>> 
>> Assessing Future Ecosystem Services: a Case 
>> Study of the Northern Highlands Lake District  Wisconsin
>> > rdf:datatype="&xsd;dateTime">2010-07-28T15:36:03
>> conference 
>> paper
>> > rdf:datatype="&xsd;string">http://doi.acm.org/10.1145/379437.9
>> Assessing Future Ecosystem Services: a Case Study of the Northern 
>> Highlands Lake District  Wisconsin
>> http://vivo.iu.edu/individual/n11"/>
>> http://vivo.iu.edu/individual/n"/>
>> > rdf:resource="http://vivo.iu.edu/individual/n"/>
>> > rdf:resource="http://vivo.iu.edu/individual/n"/>
>> 
>> 
>> 
>> I have tried with this code but the getters give me null values. Getting the 
>> two individuals by its names, getting the object property and adding them to 
>> the model.
>> 
>> Individual doc = model.getIndividual("n6356");
>> Individual ref = model.getIndividual("n6399");
>> ObjectProperty cites = 
>> model.getObjectProperty("http://purl.org/ontology/bibo/cites";);
>> model.add(doc,cites,ref);
> 
> You have to use the full URI to find the individuals,
> 
>String NS = "http://vivo.iu.edu/individual/";;
>Individual doc = model.getIndividual(NS + "n6356");
>Individual ref = model.getIndividual(NS + "n6399");
>ObjectProperty cites = 
> model.getObjectProperty("http://purl.org/ontology/bibo/cites";);
>model.add(doc,cites,ref);
> 
> Dave
> 



[jira] [Commented] (JENA-595) Improve filter placement optimization

2013-11-24 Thread Hudson (JIRA)

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

Hudson commented on JENA-595:
-

SUCCESS: Integrated in Jena_Development_Test #1049 (See 
[https://builds.apache.org/job/Jena_Development_Test/1049/])
Fixes issue with  JENA-595 (claude: rev 1544967)
* 
/jena/trunk/jena-arq/src/main/java/com/hp/hpl/jena/sparql/algebra/optimize/TransformFilterPlacement.java
* 
/jena/trunk/jena-arq/src/test/java/com/hp/hpl/jena/sparql/algebra/optimize/TestTransformFilterPlacement.java


> Improve filter placement optimization
> -
>
> Key: JENA-595
> URL: https://issues.apache.org/jira/browse/JENA-595
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Attachments: FilterPlacementError.java, JENA-595-FilterPlacement.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.1#6144)


[jira] [Commented] (JENA-595) Improve filter placement optimization

2013-11-24 Thread ASF subversion and git services (JIRA)

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

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

Commit 1544967 from [~claudenw] in branch 'jena/trunk'
[ https://svn.apache.org/r1544967 ]

Fixes issue with  JENA-595

> Improve filter placement optimization
> -
>
> Key: JENA-595
> URL: https://issues.apache.org/jira/browse/JENA-595
> Project: Apache Jena
>  Issue Type: Improvement
>  Components: ARQ
>Reporter: Andy Seaborne
>Assignee: Andy Seaborne
> Attachments: FilterPlacementError.java, JENA-595-FilterPlacement.patch
>
>




--
This message was sent by Atlassian JIRA
(v6.1#6144)


Re: Adding individuals to object property. Ontology unusually formatted.

2013-11-24 Thread Dave Reynolds

Hi,

This is a question for the jena-users list, the dev list is for people 
developing Jena itself.  However, see below ...


On 23/11/13 22:44, Nogales Moyano Alberto wrote:

Hello I am trying to add an object property between this two individuals. I also have the 
object property in the code and the individuals are in the ontology. In only need to 
connect them using a property. The individuals look like this in the code, my problem is 
that I have never work with that ontologies using this "Description" tag.



http://vivo.iu.edu/individual/n6356";>
 
 
 
 
 
 Indiana University Digital Music Library 
Project
 2010-07-28T15:36:03
 conference paper
 http://doi.acm.org/10.1145/379437.379774
 Indiana University Digital Music Library Project
 http://vivo.iu.edu/individual/n4086167"/>
 http://vivo.iu.edu/individual/n5092"/>
 http://vivo.iu.edu/individual/n6257"/>
 http://vivo.iu.edu/individual/n6300"/>
 






http://vivo.iu.edu/individual/n6399";>
 
 
 
 
 
 Assessing Future Ecosystem Services: a Case Study 
of the Northern Highlands Lake District  Wisconsin
 2010-07-28T15:36:03
 conference paper
 http://doi.acm.org/10.1145/379437.9
 Assessing Future Ecosystem Services: a Case Study of the Northern 
Highlands Lake District  Wisconsin
 http://vivo.iu.edu/individual/n11"/>
 http://vivo.iu.edu/individual/n"/>
 http://vivo.iu.edu/individual/n"/>
 http://vivo.iu.edu/individual/n"/>
 


I have tried with this code but the getters give me null values. Getting the 
two individuals by its names, getting the object property and adding them to 
the model.

 Individual doc = model.getIndividual("n6356");
 Individual ref = model.getIndividual("n6399");
 ObjectProperty cites = 
model.getObjectProperty("http://purl.org/ontology/bibo/cites";);
 model.add(doc,cites,ref);


You have to use the full URI to find the individuals,

String NS = "http://vivo.iu.edu/individual/";;
Individual doc = model.getIndividual(NS + "n6356");
Individual ref = model.getIndividual(NS + "n6399");
ObjectProperty cites = 
model.getObjectProperty("http://purl.org/ontology/bibo/cites";);

model.add(doc,cites,ref);

Dave