Re: Problem running AtomGraph/fuseki-docker

2023-12-06 Thread Steve Vestal

I was using bash.  When I run it in command prompt, it works. Thanks!

Interestingly, when the command prompt is closed, the container is 
removed from Docker Desktop.  Each new start creates a new container 
with a new amusing name :-)


C:\Users\svestal>docker run --rm -p 3030:3030 atomgraph/fuseki --mem '/ds'
[2023-12-06 22:19:53] INFO  Server  :: Apache Jena Fuseki 4.6.1
[2023-12-06 22:19:53] INFO  Server  :: Database: in-memory
[2023-12-06 22:19:53] INFO  Server  :: Path = /'/ds'
[2023-12-06 22:19:53] INFO  Server  :: System
[2023-12-06 22:19:53] INFO  Server  ::   Memory: 2.0 GiB
[2023-12-06 22:19:53] INFO  Server  ::   Java:   17-ea
[2023-12-06 22:19:53] INFO  Server  ::   OS: Linux 
5.15.133.1-microsoft-standard-WSL2 amd64

[2023-12-06 22:19:53] INFO  Server  ::   PID:    1
[2023-12-06 22:19:53] INFO  Server  :: Start Fuseki (http=3030)

On 12/6/2023 2:12 PM, Martynas Jusevičius wrote:

Hi Steve,

This looks like Windows shell issue.

For some reason /ds is resolved as a filepath where it shouldn’t.

Can you try —mem '/ds' with quotes?

I’m running Docker on WSL2 and never had this problem.

Martynas

On Wed, 6 Dec 2023 at 21.05, Steve Vestal  wrote:


I am running a VM with Microsoft Windows Server 2019 (64-bit). When I
try to stand up the docker server, I get

$ docker run --rm -p 3030:3030 atomgraph/fuseki --mem /ds
String '/C:/Program Files/Git/ds' not valid as 'service'

Suggestions?




Re: Problem running AtomGraph/fuseki-docker

2023-12-06 Thread Martynas Jusevičius
Hi Steve,

This looks like Windows shell issue.

For some reason /ds is resolved as a filepath where it shouldn’t.

Can you try —mem '/ds' with quotes?

I’m running Docker on WSL2 and never had this problem.

Martynas

On Wed, 6 Dec 2023 at 21.05, Steve Vestal  wrote:

> I am running a VM with Microsoft Windows Server 2019 (64-bit). When I
> try to stand up the docker server, I get
>
> $ docker run --rm -p 3030:3030 atomgraph/fuseki --mem /ds
> String '/C:/Program Files/Git/ds' not valid as 'service'
>
> Suggestions?
>
>


Problem running AtomGraph/fuseki-docker

2023-12-06 Thread Steve Vestal
I am running a VM with Microsoft Windows Server 2019 (64-bit). When I 
try to stand up the docker server, I get


$ docker run --rm -p 3030:3030 atomgraph/fuseki --mem /ds
String '/C:/Program Files/Git/ds' not valid as 'service'

Suggestions?



Re: Unable to build the below query using jena query builder

2023-12-06 Thread Lorenz Buehmann

Hi,

did you try addGraph method on the SelectBuilder object with another 
SelectBuilder object on which you add the VALUES clause and the triple 
pattern?


In your case with the UNION I think the flow should be something like


SelectBuilder sb = ...

SelectBuilder sb_g1 = ... // first graph pattern
sb_g1.addValueVar(

SelectBuilder sb_g2 = ... // second graph pattern

sb.addUnion(sb_g1)
sb.addUnion(sb_g2)


But, I think there might be some bug or limitation:

While

SelectBuilder sb1 = new SelectBuilder()
    .addWhere("?s", "?p", "?o")
    .addWhereValueVar("?s", "foo1")
    .addWhereValueVar("?p", "foo1")
    .addWhereValueVar("?o", "foo1");
System.out.println(sb1.buildString());


Returns the expected query

SELECT  *
WHERE
  { ?s  ?p  ?o
    VALUES ( ?s ?p ?o ) {
  ( "foo1" "foo1" "foo1" )
    }
  }

passing that builder to another builder where it is supposed to make the 
graph


Node g1 = NodeFactory.createURI("http://example/g1;);
SelectBuilder sb2 = new SelectBuilder().addGraph(g1,
    new SelectBuilder()
    .addWhere("?s", "?p", "?o")
    .addWhereValueVar("?s", "foo1")
    .addWhereValueVar("?p", "foo1")
    .addWhereValueVar("?o", "foo1"));
System.out.println(sb2.buildString());


leads to only

SELECT  *
WHERE
  { GRAPH 
  { ?s  ?p  ?o}}


From the code I'd say the issue is that the build() method isn't being 
called before adding the query pattern as element to the graph. But 
that's just a guess.



So what works is to force a build() on the WhereHandler explicitly 
before passing it to the graph:



Node g1 = NodeFactory.createURI("http://example/g1;);
SelectBuilder sbG1 = new SelectBuilder()
    .addWhere("?s", "?p", "?o")
    .addWhereValueVar("?s", "foo1")
    .addWhereValueVar("?p", "foo1")
    .addWhereValueVar("?o", "foo1");
sbG1.getWhereHandler().build(); // the important line
SelectBuilder sb2 = new SelectBuilder().addGraph(g1,
    sbG1);
System.out.println(sb2.buildString());


then we get


SELECT  *
WHERE
  { GRAPH 
  { ?s  ?p  ?o
    VALUES ( ?s ?p ?o ) {
  ( "foo1" "foo1" "foo1" )
    }
  }}


It don't know if this is intended or if you want to open an issue or 
wait for Claude Warren which is the principle maintainer of the query 
builder code and he'll provide a better answer than me.



I have one question, any reason for using Jena 3.5.0 which is 6 years old?

On 06.12.23 01:33, Dhamotharan, Kishan wrote:

Hi All,

I have been trying to construct the below query using Jena query builder. I 
have tried multiple different ways to build it, nothing seems to work. Adding 
values block inside Graph seems to be not possible. We are using Jena 3.5.


SELECT ?subject ?predicate ?object ?graph
WHERE {

{
   GRAPH  {
 ?subject ?predicate ?object

   VALUES (?subject ?predicate ?object) {
   (  )
   (  )
   (  )
  }

 BIND( AS ?graph)
   }
}

UNION

{
   GRAPH  {
 ?subject ?predicate ?object

   VALUES (?subject ?predicate ?object) {
   (  )
   (  )
   (  )
}

 BIND( AS ?graph)
   }
}

Can anyone suggest on how this can be done ? Any help is appreciated 


Thanks
Kishan Dhamotharan


--
Lorenz Bühmann
Research Associate/Scientific Developer

Email buehm...@infai.org

Institute for Applied Informatics e.V. (InfAI) | Goerdelerring 9 | 04109 
Leipzig | Germany