Initial query from Skosmos causes a fault in Jena

55 views
Skip to first unread message

Toni Cebrián

unread,
Mar 2, 2021, 4:09:17 AM3/2/21
to Skosmos Users
Hi and sorry for cross-posting,

   I'm trying to setup Fuseki with the Skosmos frontend (https://skosmos.org/) using docker images for both servers.
   In Fuseki I've uploaded to the default graph the skos.rdf file plus the .ttl with my vocabulary comprising around 4597 concepts. Fuseki is also setup with MicroOWL reasoner:

so I can navigate the SKOS taxonomy back and forth.
    The problem is that the first query that Skosmos sends to Jena never returns:

CONSTRUCT {   <http://example.org/MyScheme> ?property ?value . }  
WHERE {   
<http://example.org/MyScheme> ?property ?value .
  FILTER (?property != skos:hasTopConcept) } 

After sending the query, one CPU goes 100% and after a while before getting any results I can see this exception in fuseki:

skosmos-fuseki | [2021-03-02 08:19:04] Fuseki     INFO  Exception while writing the response model: org.eclipse.jetty.io.EofException
skosmos-fuseki | org.apache.jena.atlas.RuntimeIOException: org.eclipse.jetty.io.EofException
skosmos-fuseki |        at org.apache.jena.atlas.io.IO.exception(IO.java:261)
skosmos-fuseki |        at org.apache.jena.atlas.io.BufferingWriter.flushBuffer(BufferingWriter.java:136)
skosmos-fuseki |        at org.apache.jena.atlas.io.BufferingWriter.output(BufferingWriter.java:86)
skosmos-fuseki |        at org.apache.jena.atlas.io.BufferingWriter.write(BufferingWriter.java:173)
skosmos-fuseki |        at org.apache.jena.atlas.io.Writer2.print(Writer2.java:55)
skosmos-fuseki |        at org.apache.jena.riot.out.quoted.QuotedURI.writeURI(QuotedURI.java:46)
skosmos-fuseki |        at org.apache.jena.riot.out.NodeFormatterNT.formatURI(NodeFormatterNT.java:46)

to me it doesn't look like a very complex query, so my questions are:
- Is Jena able to handle SKOS vocabularies in the range of thousand terms when inference is on? 
- If so, how should I configure Fuseki to work with that dataset?
- Maybe related, but does anyone have a similar Skosmos setup where I could borrow the Jena config files?

Thanks

Osma Suominen

unread,
Mar 2, 2021, 6:36:15 AM3/2/21
to skosmo...@googlegroups.com
Hi Toni,

May I ask why you are using the MicroOWL reasoner? Normally Skosmos is
used with no reasoning support in Fuseki. It may well be that the
queries that Skosmos does are too heavy when reasoning has been turned
on. I've never tried.

Best,
Osma
> --
> You received this message because you are subscribed to the Google
> Groups "Skosmos Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to skosmos-user...@googlegroups.com
> <mailto:skosmos-user...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/skosmos-users/4759e0ad-a9b5-476f-8ec7-30e0389a9aaan%40googlegroups.com
> <https://groups.google.com/d/msgid/skosmos-users/4759e0ad-a9b5-476f-8ec7-30e0389a9aaan%40googlegroups.com?utm_medium=email&utm_source=footer>.

--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 15 (Unioninkatu 36)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
osma.s...@helsinki.fi
http://www.nationallibrary.fi

Toni Cebrián

unread,
Mar 2, 2021, 6:54:19 AM3/2/21
to Skosmos Users
Because in the Fuseki server I will have several taxonomies. For the tree structure of such taxonomies, some where created using skos:narrow and others skos:broader. Also there will be interrelated concepts with skos:related. 

Since I cannot assume which way a relationship was defined at creation time, I need inference to get asserted triples mainly about owl:inverseOf and transitive and symmetric properties.

Toni Cebrián

unread,
Mar 2, 2021, 6:57:23 AM3/2/21
to Skosmos Users

For the record, I was able to successfully use inference using AllegroGraph but then I faced this problem https://github.com/NatLibFi/Skosmos/issues/1126 

To be honest, I don't really care about which triple store to use, I just care about a triple store that:
- It is open source or free to use
- It interoperates with Skosmos nicely
- It allows you to materialize/infer non asserted SKOS properties.

So maybe I should be looking elsewhere, do you have suggestions?

Osma Suominen

unread,
Mar 2, 2021, 7:09:30 AM3/2/21
to skosmo...@googlegroups.com
Hi Toni,

Thank you, I think I now understand what you are aiming at. Let me
suggest an alternative approach: instead of trying to infer the missing
structure at runtime using a reasoner (which can be very slow, as you've
found out!), why not preprocess your vocabulary data so that it contains
the complete set of broader/narrower and related relationships? In fact
there is a tool for this already, called Skosify [1], originally written
by myself though others have since made important contributions.

When you process a vocabulary with Skosify, it will automatically fill
in the missing parts of the structure, and also complain about (and in
many cases try to automatically fix) any structural problems it will
find. It is a kind of "lint" tool for SKOS vocabularies. We are using it
for all vocabularies published at Finto.fi, and I've heard many others
are using it as well.

Once you have a clean, complete SKOS file you can load it into a triple
store without having to use inference.

Hope this helps,
Osma


[1] https://github.com/NatLibFi/Skosify
> Tel. +358 50 3199529 <tel:+358%2050%203199529>
> osma.s...@helsinki.fi
> http://www.nationallibrary.fi
>
> --
> You received this message because you are subscribed to the Google
> Groups "Skosmos Users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to skosmos-user...@googlegroups.com
> <mailto:skosmos-user...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/skosmos-users/b1473502-f876-4d7a-8e5e-3e659c56f974n%40googlegroups.com
> <https://groups.google.com/d/msgid/skosmos-users/b1473502-f876-4d7a-8e5e-3e659c56f974n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Toni Cebrián

unread,
Mar 3, 2021, 4:11:56 AM3/3/21
to Skosmos Users
Thanks Osma, the skosify trick allowed me to run Fuseki and now I'm able to see the skosmos frontend. 

But I'm still facing problems I cannot diagnose. For instance, as I said I have 5 SKOS vocabularies some of those interlink each other through skos:related, but:

  • When I click on a given taxonomy in the Home page, I get the Alphabetical tab full with concepts from all 5 taxonomies. Is that the expected behaviour? Does it has something to do with ingesting everything on the default graph?
  • If I go to the Hierchy tab I see all 5 folds but the hierarchy is empty. Does the skosify preprocessing needs something else to detect the hierarchy in the concept schema? Do you have an example of the config files + data when you have several taxonomies in the same fuseki instance?

Thanks. I think that if I manage to get it running I could contribute a "Getting started from zero" wiki page or blog post for Skosmos.

Osma Suominen

unread,
Mar 3, 2021, 10:52:17 AM3/3/21
to skosmo...@googlegroups.com
Hi Toni,

Good to hear that you were able to use Skosify!

If you have several vocabularies, you should load them into separate
named graphs, not the default graph. This way they shouldn't be mashed
together. That's probably the next thing you should fix, before tackling
other problems!

You said you have skos:related links between your vocabularies. That's
not wrong per se, but the normal way of linking between SKOS
vocabularies is to use the mapping properties i.e. exactMatch,
closeMatch, broadMatch, narrowMatch and relatedMatch. Skosmos has
special support for these (they will be shown as an "appendix", below
the other properties) so if you are able to adjust your data model, I
would suggest that you use these instead of generic skos:related.
Probably skos:relatedMatch is what you want - it's actually defined as a
subproperty of skos:related by SKOS.

Thanks for the offer to make a wiki page / blog post! I assume you've
found this guide: https://github.com/NatLibFi/Skosmos/wiki/InstallTutorial

I'm well aware that it may have problems, and it may not match your
situation exactly as you obviously have your own SKOS vocabularies.

-Osma


Toni Cebrián kirjoitti 3.3.2021 klo 11.11:
> Thanks Osma, the skosify trick allowed me to run Fuseki and now I'm able
> to see the skosmos frontend.
>
> But I'm still facing problems I cannot diagnose. For instance, as I said
> I have 5 SKOS vocabularies some of those interlink each other through
> skos:related, but:
>
> * When I click on a given taxonomy in the Home page, I get the
> Alphabetical tab full with concepts from all 5 taxonomies. Is that
> the expected behaviour? Does it has something to do with ingesting
> everything on the default graph?
> * If I go to the Hierchy tab I see all 5 folds but the hierarchy is
> empty. Does the skosify preprocessing needs something else to detect
> the hierarchy in the concept schema? Do you have an example of the
> config files + data when you have several taxonomies in the same
> fuseki instance?
> *
> https://groups.google.com/d/msgid/skosmos-users/553ce22b-5ddc-4468-909c-baae8fd99984n%40googlegroups.com
> <https://groups.google.com/d/msgid/skosmos-users/553ce22b-5ddc-4468-909c-baae8fd99984n%40googlegroups.com?utm_medium=email&utm_source=footer>.

Toni Cebrián

unread,
Mar 9, 2021, 3:53:10 AM3/9/21
to Osma Suominen, skosmo...@googlegroups.com
OK, I've tried having each graph on a separated named graph and now I'm facing another problem.

The moment I click on the taxonomy link I get a 500 HTTP error, and if I check logs for the apache server I get:

[Tue Mar 09 08:46:19.941706 2021] [php7:error] [pid 31] [client 172.23.0.1:38880] PHP Fatal error:  Uncaught Error: Call to undefined method EasyRdf\\Literal::getUri() in /var/www/html/model/Vocabulary.php:46\nStack trace:\n#0 /var/www/html/model/Vocabulary.php(60): Vocabulary->getGraph()\n#1 /var/www/html/model/Vocabulary.php(154): Vocabulary->getSparql()\n#2 /var/www/html/vendor/twig/twig/lib/Twig/Extension/Core.php(1605): Vocabulary->getInfo('en')\n#3 /tmp/skosmos-template-cache/13/137b8869907f07c452d8334a3d88112811ec5522b55d445ddeb7dfa36d0f4db2.php(37): twig_get_attribute(Object(Twig_Environment), Object(Twig_Source), Object(Vocabulary), 'info', Array, 'method')\n#4 /var/www/html/vendor/twig/twig/lib/Twig/Template.php(390): __TwigTemplate_a773ca80af98e53d8bc0cf27cd043dc595761e69e539d0d9a79be078b9ced6bc->doDisplay(Array, Array)\n#5 /var/www/html/vendor/twig/twig/lib/Twig/Template.php(367): Twig_Template->displayWithErrorHandling(Array, Array)\n#6 /tmp/skosmos-template-cache/05/05a20722dd6d8f865e1a71ce83ba1aa634bf45eaf4314cb53b37503f1cfe4dbe.php(192): Twig_Template->display(Array)\n#7 /var/www/html/vendor/twig/twig in /var/www/html/model/Vocabulary.php on line 46, referer: http://localhost:8000/en/

I'm running skosmos and Jena using https://github.com/kinow/skosmos-docker and this is the config I use for the vocabulary if that helps
:cpc a skosmos:Vocabulary, void:Dataset ;
    dc:title "CPC taxonomy"@en ;
    dc:subject :cat_general ;
    dc:type mdrtype:ONTOLOGY ;
    void:uriSpace "http://data.greeneffort.org/ontologies/skos/" ;
    skosmos:language "en";
    skosmos:defaultLanguage "en";
    skosmos:sparqlGraph "http://data.greeneffort.org/ontologies/skos/cpc" ;
    skosmos:showTopConcepts "true";
    skosmos:showStatistics "false";
    skosmos:loadExternalResources "false";
    skosmos:shortName "CPC";
    skosmos:groupClass isothes:ConceptGroup ;
    skosmos:arrayClass isothes:ThesaurusArray ;
    void:sparqlEndpoint <http://fuseki:3030/greeneffort/sparql> ;
    skosmos:mainConceptScheme <http://data.greeneffort.org/ontologies/skos/cpc#CPCScheme>

Right now I just have 1 taxonomy in the CPC named graph. And I've double checked that if I run :
PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
SELECT
(COUNT(*) AS ?count)
WHERE {
  GRAPH <http://data.greeneffort.org/ontologies/skos/cpc> {
    ?s ?p ?o
  }
}
I get 22000 triples.

I'm running out of ideas to try, any suggestion on what to look at?


To unsubscribe from this group and stop receiving emails from it, send an email to skosmos-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skosmos-users/76b80543-19c3-72ec-7eb3-10070f0e75ca%40helsinki.fi.

Osma Suominen

unread,
Mar 9, 2021, 4:01:03 AM3/9/21
to skosmo...@googlegroups.com
Hi Toni,

try expressing the graph URI as a resource (not a literal) in the
configuration file, i.e.

skosmos:sparqlGraph <http://data.greeneffort.org/ontologies/skos/cpc> ;

Hope this helps,
Osma

Toni Cebrián kirjoitti 9.3.2021 klo 10.52:
> OK, I've tried having each graph on a separated named graph and now I'm
> facing another problem.
>
> The moment I click on the taxonomy link I get a 500 HTTP error, and if I
> check logs for the apache server I get:
>
> [Tue Mar 09 08:46:19.941706 2021] [php7:error] [pid 31] [client
> 172.23.0.1:38880 <http://172.23.0.1:38880>] PHP Fatal error:
> <http://org.eclipse.jetty.io>.EofException
> >      > > skosmos-fuseki | org.apache.jena.atlas.RuntimeIOException:
> >      > > org.eclipse.jetty.io
> <http://org.eclipse.jetty.io>.EofException
> >      > > skosmos-fuseki |        at
> >      > > org.apache.jena.atlas.io.IO
> <http://org.apache.jena.atlas.io.IO>.exception(IO.java:261)
> >      > > skosmos-fuseki |        at
> >      > >
> >      >
> > org.apache.jena.atlas.io
> <http://org.apache.jena.atlas.io>.BufferingWriter.flushBuffer(BufferingWriter.java:136)
> >
> >      >
> >      > > skosmos-fuseki |        at
> >      > >
> >      >
> > org.apache.jena.atlas.io
> <http://org.apache.jena.atlas.io>.BufferingWriter.output(BufferingWriter.java:86)
> >
> >      >
> >      > > skosmos-fuseki |        at
> >      > >
> >      >
> > org.apache.jena.atlas.io
> <http://org.apache.jena.atlas.io>.BufferingWriter.write(BufferingWriter.java:173)
> >
> >      >
> >      > > skosmos-fuseki |        at
> >      > > org.apache.jena.atlas.io
> <http://org.apache.jena.atlas.io>.Writer2.print(Writer2.java:55)
> >      > > <mailto:skosmos-user...@googlegroups.com
> <mailto:skosmos-user...@googlegroups.com>>.
> >      > > To view this discussion on the web visit
> >      > >
> >      >
> >
> https://groups.google.com/d/msgid/skosmos-users/4759e0ad-a9b5-476f-8ec7-30e0389a9aaan%40googlegroups.com
> >
> >      >
> >      > >
> >      >
> >
>  <https://groups.google.com/d/msgid/skosmos-users/4759e0ad-a9b5-476f-8ec7-30e0389a9aaan%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >
> >      >
> >      >
> >      > --
> >      > Osma Suominen
> >      > D.Sc. (Tech), Information Systems Specialist
> >      > National Library of Finland
> >      > P.O. Box 15 (Unioninkatu 36)
> >      > 00014 HELSINGIN YLIOPISTO
> >      > Tel. +358 50 3199529 <tel:+358%2050%203199529>
> >     <tel:+358%2050%203199529>
> >      > osma.s...@helsinki.fi <mailto:osma.s...@helsinki.fi>
> >      > http://www.nationallibrary.fi
> >      >
> >      > --
> >      > You received this message because you are subscribed to
> the Google
> >      > Groups "Skosmos Users" group.
> >      > To unsubscribe from this group and stop receiving emails
> from it,
> >     send
> >      > an email to skosmos-user...@googlegroups.com
> <mailto:skosmos-user...@googlegroups.com>
> >      > <mailto:skosmos-user...@googlegroups.com
> <mailto:skosmos-user...@googlegroups.com>>.
> >      > To view this discussion on the web visit
> >      >
> >
> https://groups.google.com/d/msgid/skosmos-users/b1473502-f876-4d7a-8e5e-3e659c56f974n%40googlegroups.com
> >
> >      >
> >
>  <https://groups.google.com/d/msgid/skosmos-users/b1473502-f876-4d7a-8e5e-3e659c56f974n%40googlegroups.com?utm_medium=email&utm_source=footer>.
> >
> >
> >     --
> >     Osma Suominen
> >     D.Sc. (Tech), Information Systems Specialist
> >     National Library of Finland
> >     P.O. Box 15 (Unioninkatu 36)
> >     00014 HELSINGIN YLIOPISTO
> >     Tel. +358 50 3199529 <tel:+358%2050%203199529>
> > osma.s...@helsinki.fi <mailto:osma.s...@helsinki.fi>
> > http://www.nationallibrary.fi
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "Skosmos Users" group.
> > To unsubscribe from this group and stop receiving emails from it,
> send
> > an email to skosmos-user...@googlegroups.com
> <mailto:skosmos-users%2Bunsu...@googlegroups.com>
> > <mailto:skosmos-user...@googlegroups.com
> <mailto:skosmos-users%2Bunsu...@googlegroups.com>>.
> > To view this discussion on the web visit
> >
> https://groups.google.com/d/msgid/skosmos-users/553ce22b-5ddc-4468-909c-baae8fd99984n%40googlegroups.com
>
> >
> <https://groups.google.com/d/msgid/skosmos-users/553ce22b-5ddc-4468-909c-baae8fd99984n%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> Osma Suominen
> D.Sc. (Tech), Information Systems Specialist
> National Library of Finland
> P.O. Box 15 (Unioninkatu 36)
> 00014 HELSINGIN YLIOPISTO
> Tel. +358 50 3199529
> osma.s...@helsinki.fi <mailto:osma.s...@helsinki.fi>
> http://www.nationallibrary.fi
>
> --
> You received this message because you are subscribed to the Google
> Groups "Skosmos Users" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to skosmos-user...@googlegroups.com
> <mailto:skosmos-users%2Bunsu...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/skosmos-users/76b80543-19c3-72ec-7eb3-10070f0e75ca%40helsinki.fi.

Toni Cebrián

unread,
Mar 9, 2021, 4:11:30 AM3/9/21
to Osma Suominen, skosmo...@googlegroups.com
Thanks Osma, 

  That fixed the issue but now I'm stuck trying to get Hierarchy working. It somehow works because I can go from a concept in the Alphabetical list to the hierarchy entry, but whenever I click on the tab Hierarchy I get:

image.png

Any ideas?

To unsubscribe from this group and stop receiving emails from it, send an email to skosmos-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/skosmos-users/51eaf348-fa50-198e-2f09-6c8f2e97d3dc%40helsinki.fi.
Reply all
Reply to author
Forward
0 new messages