Andy Seaborne kirjoitti 11.8.2021 17:38:
Hi there,

There isn't enough information to see what's happening.


Hello,

I don't know it this message was already received by the recipients as I tried to send 2 MB file as an attachment. Sorry for the inconvenience in that case !

Anyway, now the file has been stored in github, so pls see the steps to repeat the issue below.



1) start source apache-jena-fuseki-server on port 3030

2) start target apache-jena-fuseki-3.17.0-server on port 3031

3) upload the file ds.trig from https://github.com/jamietti/jena into source apache-jena-fuseki-server on port 3030 using command

curl -XPOST --header 'Content-Type: application/trig' --data-binary @ds.trig http://<source apache-jena-fuseki-server>:3030/<source dataset>

4) create one in-memory dataset and one persistent dataset on target apache-jena-fuseki-3.17.0-server

5) update the source apache-jena-fuseki-server and source dataset in combine_NGs.sparql-file

6) run combine_NGs.sparql-script in in-memory dataset and persistent dataset of the target apache-jena-fuseki-3.17.0-server

7) run query

    SELECT ?subject ?predicate ?object
      WHERE {
       ?subject ?predicate ?object
      }

in in-memory dataset and persistent dataset of the target apache-jena-fuseki-3.17.0-server and compare the results.

See attachements in_memory.png and persistent.png for my results after the above procedure.

Jaana



The first thing to do is dump, or Fuseki backup, the database from
each setup and see if they are the same.

Then if they are, send a minimal reproducible example [1].
Something someone else can run.

    Andy

[1]
https://stackoverflow.com/help/minimal-reproducible-example


On 11/08/2021 13:35, [email protected] wrote:
Hello,

My jena-fuseki database consists of several named graphs. In order to provide users graphql-like interface to jena-fuseki I have to combine my NGs into one big default graph for HyperGraphql (https://www.hypergraphql.org/) that provides the interface.

At some point the users started to get less data than before and when I investigated the issue I noticed that this was after upgrading jena-fuseki from 3.13 to 3.17 !

To combine the NGs I'm using the following command:

  curl -i -H "Content-Type: application/sparql-update"  -X POST http://<myTargetHost>:8061/<myDs>/update --data-binary "@./combine-NGs.sparql"

(see NGs_to_be_combined.txt for hint of my source database and combine-NGs.sparql as the executed script).

So I run the combine-NGs.sparql-script in the target jena host and the target dataset.

If I use in-memory dataset as my target dataset I get only half of the triplets cmapared to the amount of triplets with persistent dataset. This happens only with jena-fuseki 3.17.

In 3.13 I haven't seen this issue!

Br, Jaana



drop all;

# Copy all NGs into local
insert{
  graph ?g {
    ?s ?p ?o
  }
}
where{
  service <http://<source apache-jena-fuseki-server>:3030/<source 
dataset>/query> {        # original RDF-dataset
    {
      graph ?g { }.
    }
    graph ?g {
      ?s ?p ?o
    }
  }
};

# Alter: Variable as object
delete{
  graph ?g {
    ?s ?p ?o_before.
  }
}
insert{
  graph ?g {
    ?s ?p ?o_after.
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?o_before a <http://www.example.org/rdf/ontologies/gsimsf/Variable>.
    ?s ?p ?o_before.
    bind(iri(concat("http://www.example.org/rdf/data/gsimsf/Variable/";, 
strafter(str(?g), "http://www.example.org/tilasto/";), "/", 
strafter(str(?o_before), "http://www.example.org/rdf/data/gsimsf/Variable/";))) 
as ?o_after)
  }
};

# Alter: Variable as subject
delete{
  graph ?g {
        ?s_before ?p ?o.
  }
}
insert{
  graph ?g {
        ?s_after ?p ?o.
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?s_before a <http://www.example.org/rdf/ontologies/gsimsf/Variable>.
    ?s_before ?p ?o.
    bind(iri(concat("http://www.example.org/rdf/data/gsimsf/Variable/";, 
strafter(str(?g), "http://www.example.org/tilasto/";), "/", 
strafter(str(?s_before), "http://www.example.org/rdf/data/gsimsf/Variable/";))) 
as ?s_after)
  }
};


# Alter: EnumeratedValueDomain as object
delete{
  graph ?g {
    ?s ?p ?o_before.
  }
}
insert{
  graph ?g {
    ?s ?p ?o_after.
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?o_before a 
<http://www.example.org/rdf/ontologies/gsimsf/EnumeratedValueDomain>.
    ?s ?p ?o_before.
    
bind(iri(concat("http://www.example.org/rdf/data/gsimsf/EnumeratedValueDomain/";,
 strafter(str(?g), "http://www.example.org/tilasto/";), "/", 
strafter(str(?o_before), 
"http://www.example.org/rdf/data/gsimsf/EnumeratedValueDomain/";))) as ?o_after)
  }
};

# Alter: EnumeratedValueDomain as subject
delete{
  graph ?g {
        ?s_before ?p ?o.
  }
}
insert{
  graph ?g {
        ?s_after ?p ?o.
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?s_before a 
<http://www.example.org/rdf/ontologies/gsimsf/EnumeratedValueDomain>.
    ?s_before ?p ?o.
    
bind(iri(concat("http://www.example.org/rdf/data/gsimsf/EnumeratedValueDomain/";,
 strafter(str(?g), "http://www.example.org/tilasto/";), "/", 
strafter(str(?s_before), 
"http://www.example.org/rdf/data/gsimsf/EnumeratedValueDomain/";))) as ?s_after)
  }
};

# Alter: DescribedValueDomain as object
delete{
  graph ?g {
    ?s ?p ?o_before.
  }
}
insert{
  graph ?g {
    ?s ?p ?o_after.
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?o_before a 
<http://www.example.org/rdf/ontologies/gsimsf/DescribedValueDomain>.
    ?s ?p ?o_before.
    
bind(iri(concat("http://www.example.org/rdf/data/gsimsf/DescribedValueDomain/";, 
strafter(str(?g), "http://www.example.org/tilasto/";), "/", 
strafter(str(?o_before), 
"http://www.example.org/rdf/data/gsimsf/DescribedValueDomain/";))) as ?o_after)
  }
};

# Alter: DescribedValueDomain as subject
delete{
  graph ?g {
        ?s_before ?p ?o.
  }
}
insert{
  graph ?g {
        ?s_after ?p ?o.
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?s_before a 
<http://www.example.org/rdf/ontologies/gsimsf/DescribedValueDomain>.
    ?s_before ?p ?o.
    
bind(iri(concat("http://www.example.org/rdf/data/gsimsf/DescribedValueDomain/";, 
strafter(str(?g), "http://www.example.org/tilasto/";), "/", 
strafter(str(?s_before), 
"http://www.example.org/rdf/data/gsimsf/DescribedValueDomain/";))) as ?s_after)
  }
};


# Add ?CodedVariable 
<http://www.example.org/rdf/data/gsimsf/isPresentationOfRepresentedVariable> 
?Variable
insert{
  graph ?g {
        ?CodedVariable 
<http://www.example.org/rdf/data/gsimsf/isPresentationOfRepresentedVariable> 
?Variable
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?Variable a <http://www.example.org/rdf/ontologies/gsimsf/Variable>;
      <http://www.example.org/rdf/data/gsimsf/hasEnumeratedValueDomain> 
?EnumeratedValueDomain.
    ?CodedVariable a 
<http://www.example.org/rdf/ontologies/pxt/PxCodedVariable> ;
      
<http://www.example.org/rdf/data/pxt/isPresentationOfEnumeratedValueDomain> 
?EnumeratedValueDomain.
  }
};

# Add ?NumericalVariable 
<http://www.example.org/rdf/data/gsimsf/isPresentationOfRepresentedVariable> 
?Variable
insert{
  graph ?g {
        ?NumericalVariable 
<http://www.example.org/rdf/data/gsimsf/isPresentationOfRepresentedVariable> 
?Variable
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?Variable a <http://www.example.org/rdf/ontologies/gsimsf/Variable>;
      <http://www.example.org/rdf/data/gsimsf/hasDescribedValueDomain> 
?DescribedValueDomain.
    ?NumericalVariable a 
<http://www.example.org/rdf/ontologies/pxt/PxNumericalVariable> ;
      
<http://www.example.org/rdf/data/pxt/isPresentationOfDescribedValueDomain> 
?DescribedValueDomain.
  }
};

# refersToOutputFile to IRI
delete{
  graph ?g {
        ?CubeMeta <http://www.example.org/rdf/data/cubemeta/refersToOutputFile> 
?outputFileRef.
  }
}
insert{
  graph ?g {
        ?CubeMeta <http://www.example.org/rdf/data/cubemeta/refersToOutputFile> 
?OutputFile.
  }
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?CubeMeta a <http://www.example.org/rdf/ontologies/cubemeta/CubeMeta> ;
      <http://www.example.org/rdf/data/cubemeta/refersToOutputFile> 
?outputFileRef.
    bind(iri(concat("http://www.example.org/rdf/data/outchannel/OutputFile/";, 
substr(?outputFileRef, 1,4), "/", substr(?outputFileRef, 7,6))) as ?OutputFile)
  }
};

# Cobine named graphs
insert{
  ?s ?p ?o.
}
where{
  {
    graph ?g { }.
  }
  graph ?g {
    ?s ?p ?o.
  }
};

# keep just default
drop named;

# refersToOutputChannel IRIksi
delete{
  ?OutputFile 
<http://www.example.org/rdf/data/outchannel/refersToOutputChannel> 
?outputChannelRef.
}
insert{
  ?OutputFile 
<http://www.example.org/rdf/data/outchannel/refersToOutputChannel> 
?OutputChannel.
}
where{
  ?OutputFile a <http://www.example.org/rdf/ontologies/outchannel/OutputFile> ;
    <http://www.example.org/rdf/data/outchannel/refersToOutputChannel> 
?outputChannelRef.
  ?OutputChannel a 
<http://www.example.org/rdf/ontologies/outchannel/OutputChannel> ;
    <http://www.example.org/rdf/data/outchannel/hasOutputChannelId> 
?outputChannelRef.
};

Reply via email to