Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught EasyRdf_Exception #635

Closed
mhabsaoui opened this issue Oct 13, 2017 · 19 comments
Closed

Uncaught EasyRdf_Exception #635

mhabsaoui opened this issue Oct 13, 2017 · 19 comments

Comments

@mhabsaoui
Copy link

mhabsaoui commented Oct 13, 2017

At which URL did you encounter the problem?

http://localhost:8080/Biodiversit%C3%A9_ARK/fr/

What steps will reproduce the problem?

  1. Select any vocabulary on front page.
  2. the error shows up on blank page

What is the expected output? What do you see instead?

What browser did you use? (eg. Firefox, Chrome, Safari, Internet explorer)

Firefox, Chrome

PS:

image

image

Thanks.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 13, 2017

I have also seen this error on Front page reload :

image

image

Could it be PHP-Apache server related ??

PS: the nav bar is showing weird, even with locale_gen Fr...

image

Thanks.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 14, 2017

I have checked the requirements for easyrdf on https://packagist.org/packages/easyrdf/easyrdf

Requires
php: >=5.2.8 ==> php 7.X
ext-mbstring: * ==> extension activated in Dockerfile of php : RUN docker-php-ext-install gettext mbstring
ext-pcre: * ==> activated by default in php

I'm thinking about issues when easyrdf is running from inside a Docker container...

Also, I had cloned the latest stable branch v1.9-maintenance.

WTH...

@osma
Copy link
Member

osma commented Oct 14, 2017

This looks like a socket related networking problem that is basically unrelated to Skosmos or EasyRdf. Search for the error "Cannot assign requested address" for hints. Are you using huge numbers of socket connections in Apache?

Are you using SELinux? Is it possible that Apache cannot connect to port 3030?

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 14, 2017

This looks like a socket related networking problem that is basically unrelated to Skosmos or EasyRdf. Search for the error "Cannot assign requested address" for hints.

Thanks for your hint 👍

Are you using huge numbers of socket connections in Apache? Are you using SELinux? Is it possible that Apache cannot connect to port 3030?

I don't think so, I'm using official docker image "php:7.0-apache" to which I only add the required extensions (gettext mbstring, rewrite...). I didn't modified any Apache config (apche2.conf, httpd.conf...), so all is by default as this is Skosmos .htaccess file's settings that overides.

This container is exposed on "3030:3030" ports ==> As said, YAGUI Tool can perfectly connect to localhost Jena-fuseki TripleStore...

All my development is made on Ubuntu 16.04 LTS, so no SELinux.

Thanks.

@osma
Copy link
Member

osma commented Oct 14, 2017

Is the Apache container allowed to make connections to the outside world? Since it's a different container than the Fuseki one, its localhost isn't the same thing. But I have very limited experience with Docker containers.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 14, 2017

OK, by modifying the setting "localhost" to "fuseki" on skosmos 'config.inc' file => it seems better now 👍
==> This topic was helpful: docker-library/php#320

But now, I've got 2 weird things more to solve:

  • the page showing the sparql endoint content is empty

image

skosmos console log:

[2017-10-14 19:59:29] INFO [qid 89132] SPARQL query:
SELECT ?cs ?label ?preflabel ?title FROM http://fuseki:3030/ds/data/Biodiversite_ark
WHERE {
?cs a skos:ConceptScheme .
OPTIONAL {
?cs rdfs:label ?label .
FILTER(langMatches(lang(?label), 'fr'))
}
OPTIONAL {
?cs skos:prefLabel ?preflabel .
FILTER(langMatches(lang(?preflabel), 'fr'))
}
OPTIONAL {
{ ?cs dc11:title ?title }
UNION
{ ?cs dc:title ?title }
FILTER(langMatches(lang(?title), 'fr'))
}
} ORDER BY ?cs
[2017-10-14 19:59:29] INFO [qid 89132] result: 0 rows returned in 5 ms

fuseki container log:

fuseki | [2017-10-14 19:59:29] Fuseki INFO [174] GET http://fuseki:3030/ds/sparql?query=PREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX+dc11%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX+skos%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E%0ASELECT+%3Fcs+%3Flabel+%3Fpreflabel+%3Ftitle+FROM+%3Chttp%3A%2F%2Ffuseki%3A3030%2Fds%2Fdata%2FBiodiversite_ark%3E%0AWHERE+%7B%0A+%3Fcs+a+skos%3AConceptScheme+.%0A+OPTIONAL+%7B%0A+++%3Fcs+rdfs%3Alabel+%3Flabel+.%0A+++FILTER%28langMatches%28lang%28%3Flabel%29%2C+%27fr%27%29%29%0A+%7D%0A+OPTIONAL+%7B%0A+++%3Fcs+skos%3AprefLabel+%3Fpreflabel+.%0A+++FILTER%28langMatches%28lang%28%3Fpreflabel%29%2C+%27fr%27%29%29%0A+%7D%0A+OPTIONAL+%7B%0A+++%7B+%3Fcs+dc11%3Atitle+%3Ftitle+%7D%0A+++UNION%0A+++%7B+%3Fcs+dc%3Atitle+%3Ftitle+%7D%0A+++FILTER%28langMatches%28lang%28%3Ftitle%29%2C+%27fr%27%29%29%0A+%7D%0A%7D+ORDER+BY+%3Fcs
fuseki | [2017-10-14 19:59:29] Fuseki INFO [174] GET /ds :: 'sparql' :: ? query=PREFIX+dc%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%3E%0APREFIX+dc11%3A+%3Chttp%3A%2F%2Fpurl.org%2Fdc%2Felements%2F1.1%2F%3E%0APREFIX+rdfs%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%3E%0APREFIX+skos%3A+%3Chttp%3A%2F%2Fwww.w3.org%2F2004%2F02%2Fskos%2Fcore%23%3E%0ASELECT+%3Fcs+%3Flabel+%3Fpreflabel+%3Ftitle+FROM+%3Chttp%3A%2F%2Ffuseki%3A3030%2Fds%2Fdata%2FBiodiversite_ark%3E%0AWHERE+%7B%0A+%3Fcs+a+skos%3AConceptScheme+.%0A+OPTIONAL+%7B%0A+++%3Fcs+rdfs%3Alabel+%3Flabel+.%0A+++FILTER%28langMatches%28lang%28%3Flabel%29%2C+%27fr%27%29%29%0A+%7D%0A+OPTIONAL+%7B%0A+++%3Fcs+skos%3AprefLabel+%3Fpreflabel+.%0A+++FILTER%28langMatches%28lang%28%3Fpreflabel%29%2C+%27fr%27%29%29%0A+%7D%0A+OPTIONAL+%7B%0A+++%7B+%3Fcs+dc11%3Atitle+%3Ftitle+%7D%0A+++UNION%0A+++%7B+%3Fcs+dc%3Atitle+%3Ftitle+%7D%0A+++FILTER%28langMatches%28lang%28%3Ftitle%29%2C+%27fr%27%29%29%0A+%7D%0A%7D+ORDER+BY+%3Fcs
fuseki | [2017-10-14 19:59:29] Fuseki INFO [174] Query = PREFIX dc: http://purl.org/dc/terms/ PREFIX dc11: http://purl.org/dc/elements/1.1/ PREFIX rdfs: http://www.w3.org/2000/01/rdf-schema# PREFIX skos: http://www.w3.org/2004/02/skos/core# SELECT ?cs ?label ?preflabel ?title FROM http://fuseki:3030/ds/data/Biodiversite_ark WHERE { ?cs a skos:ConceptScheme . OPTIONAL { ?cs rdfs:label ?label . FILTER(langMatches(lang(?label), 'fr')) } OPTIONAL { ?cs skos:prefLabel ?preflabel . FILTER(langMatches(lang(?preflabel), 'fr')) } OPTIONAL { { ?cs dc11:title ?title } UNION { ?cs dc:title ?title } FILTER(langMatches(lang(?title), 'fr')) } } ORDER BY ?cs
fuseki | [2017-10-14 19:59:30] Fuseki INFO [174] 200 OK (3 ms)

Thanks.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 14, 2017

Hmm, I've tried Skosmos "vacabularies.ttl.dist" ==> it acces correctly the concepts data. The hierarchy is not empty 👍

But when I try the Sparql request made from Skosmos (with my vocabularies.ttl) under Yasgui and it seems not to be validated
==> dc11 ??
image

If I remove that line => I get something but don't know if relevant...

image

@kinow
Copy link
Collaborator

kinow commented Oct 14, 2017

I think that's because the dc11 namespace has not been defined.

i.e. maybe the query needs a line like this near the top of the prefixes declaration.

prefix dc11: <http://purl.org/dc/elements/1.1/>

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 15, 2017

@kinow Thanks. I've already tried it under Yasgui, adding that prefix makes the sparql query validated and still returns a result (1 entries...).

OK. Then, I've added this xmlns into my .rdf file and re-uploaded it Fuseki triplestore

image

==> the same behaviour : no data returned back from Fuseeki to Skosmos hierarchy view..

PS: Maybe there is a bad alignment between my .ttl / .rdf files ==> @osma Is it possible to get the .rdf/.xml file corresponding to your vocabularies.ttl.dist, so I can make confirm-tests ?

Thanks.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 15, 2017

If I check On Yasgui the source address (FROM) made by Skomos sparql query ==> 404

image

with localhost, not better...

image

@mhabsaoui
Copy link
Author

@osma I've downloaded ysa/yso .rdf+xml content

Just wondering how to replace parameters in vocabularies.ttl ??

void:sparqlEndpoint http://api.dev.finto.fi/sparql ;
skosmos:sparqlGraph http://www.yso.fi/onto/ysa/ .

void:sparqlEndpoint http://fuseki:3030/ds/sparql ;
skosmos:sparqlGraph http://fuseki:3030/ds/data/onto/ysa/ .

Thanks

@osma
Copy link
Member

osma commented Oct 15, 2017

@mhabsaoui I have difficulty following what you're trying to accomplish. My suggestion would be that you walk through InstallTutorial in the wiki, in a virtual machine. Then once you have it working you can start changing things one at a time. If things go wrong, it's easy to trace what caused it.

If you start with a completely custom configuration (e.g. both Fuseki abd Apache in Docker and your own vocabulary) it's much more difficult to debug problems.

Also I suggest that you ask for help on the skosmos-users Google group. You might find people there with similar setups. This issue tracker is meant for reporting bugs and it's followed by only a few devs, not the larger community of users.

vocabularies.ttl is just a text file you can edit.

@osma
Copy link
Member

osma commented Oct 15, 2017

@mhabsaoui I re-read what you posted above and it seems to me you may hava a problem with graph URIs. In Fuseki you can store RDF graphs (eg from rdf/xml or ttl files) either into sn unnamed default graph, or to a named graph with a URI. Generally it is easier to use one named graph per vocabulary, as there is just one default graph. So you pick a URI for your vocabulary (often the URI namespace is a good choice), store the data in Fuseki in a graph with that URI (you can do this from the Fuseki UI, or with the s-put command line tool), and then you set the graph URI as skosmos:sparqlGraph in vocabularies.ttl. When everything matches Skosmos will display your data. But looking at the SPARQL queries you've tried, it seems that you've perhaps mixed up the graph URI with the SPARQL HTTP Graph Store endpoint URI (often something that ends with /data).

If you prefer to use the default graph in Fuseki, then simply omit the skosmos:sparqlGraph setting. That works, but you're limited to a single vocabulary per Fuseki dataset.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 15, 2017

@osma Thanks for your complete feedback 👍

My suggestion would be that you walk through InstallTutorial in the wiki, in a virtual machine.

In fact, we already made a version of Skosmos+Fuseki running and working in Docker containers following exactly the InstallTutorial in the wiki (all things manually installed).
What I'm trying to accomplish is just to make the same, but this time by using already existing official docker images (official php-apache) and just adding necessary modules for php/apache...

Untill now, I solved the access bug to Fuseki on localhost (docker network), and now I'm just trying to understand why Skosmos is getting a "result: 0" on requests made to fuseki.

But looking at the SPARQL queries you've tried, it seems that you've perhaps mixed up the graph URI with the SPARQL HTTP Graph Store endpoint URI (often something that ends with /data).
If you prefer to use the default graph in Fuseki, then simply omit the skosmos:sparqlGraph setting. That works, but you're limited to a single vocabulary per Fuseki dataset.

About graph/'SPARQL HTTP Graph Store endpoint' URIs, my vocabulary has a named sparqlGraph (declared in vocabularies.ttl as following). And I upload the .rdf file to Fuseki through jena-admin interface.

:Biodiversité_ARK a skosmos:Vocabulary, void:Dataset ;
dc:title "Biodiversity_ark"@en;
dc:title "Biodiversité_ark"@fr;
dc:subject :cat_bio;
skosmos:language "en","fr";
skosmos:defaultLanguage "en";
void:uriSpace "http://dx.doi.org/10.5072/vocabs/biodiversite";
skosmos:showTopConcepts "true";
skosmos:loadExternalResources "false";
void:sparqlEndpoint http://fuseki:3030/ds/sparql ;
skosmos:sparqlGraph http://fuseki:3030/ds/data/Biodiversite_ark .

So as you can see above, if I'm not wrong:
=> graph URI : http://fuseki:3030/ds/data/Biodiversite_ark
=> Graph Store endpoint URI : http://fuseki:3030/ds/sparql

Thanks.

@osma
Copy link
Member

osma commented Oct 15, 2017

@mhabsaoui Right. Your graph URI was confusingly close to the Graph Store endpoint URI.

Are you sure you used exactly this graph URI when you uploaded your data to Fuseki?

I would advise you to upload a vocabulary that is known to work in Skosmos - for example STW Thesaurus is a good test case - into your Fuseki. Use the graph URI and vocabularies.ttl snippet you can find in the InstallTutorial, except you have to adjust your SPARQL endpoint URI (fuseki instead of localhost).

Since you are getting entries in the Fuseki log, it seems that the connection between Apache/PHP/Skosmos/EasyRdf and Fuseki is now working properly. All you should need now is to make sure the graph URIs match.

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 16, 2017

@osma Yay, your hints did the trick. In fact, when uploading .rdf file I was missing setting the Destination graph name value, letting it to default...
image

With graph naming, it shows all well 👍

image

PS:

  • Strange that I didn't needed to touch the 'ds.ttl' (e.g. skosmos.ttl) to add any further setting like on your InstallTutorial:

image

content of ds.ttl by ddefault:

@prefix :      <http://base/#> .
@prefix tdb:   <http://jena.hpl.hp.com/2008/tdb#> .
@prefix rdf:   <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix ja:    <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix rdfs:  <http://www.w3.org/2000/01/rdf-schema#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .

:service_tdb_all  a                   fuseki:Service ;
        rdfs:label                    "TDB ds" ;
        fuseki:dataset                :tdb_dataset_readwrite ;
        fuseki:name                   "ds" ;
        fuseki:serviceQuery           "query" , "sparql" ;
        fuseki:serviceReadGraphStore  "get" ;
        fuseki:serviceReadWriteGraphStore
                "data" ;
        fuseki:serviceUpdate          "update" ;
        fuseki:serviceUpload          "upload" .

:tdb_dataset_readwrite
        a             tdb:DatasetTDB ;
        tdb:location  "/fuseki/databases/ds" .

content of config.ttl by default:

# Licensed under the terms of http://www.apache.org/licenses/LICENSE-2.0

## Fuseki Server configuration file.

@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .

[] rdf:type fuseki:Server ;
   # Example::
   # Server-wide query timeout.
   #
   # Timeout - server-wide default: milliseconds.
   # Format 1: "1000" -- 1 second timeout
   # Format 2: "10000,60000" -- 10s timeout to first result,
   #                            then 60s timeout for the rest of query.
   #
   # See javadoc for ARQ.queryTimeout for details.
   # This can also be set on a per dataset basis in the dataset assembler.
   #
   # ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "30000" ] ;

   # Add any custom classes you want to load.
   # Must have a "public static void init()" method.
   # ja:loadClass "your.code.Class" ;

   # End triples.
   .

Well thanks for your patient support. And if you're interested in a Skosmos-docker or a Skosmos-Fuseki-docker flavor project for the community let me know.

Cheers.

@osma
Copy link
Member

osma commented Oct 16, 2017

@mhabsaoui You can use the default dataset/TDB config, but it doesn't have a text index. With larger vocabularies (more than a few thousand concepts), a text index is in practice necessary for good performance.

I'm glad you got it working! One thing that would help is writing a tutorial (in the style of InstallTutorial) for how to use Skosmos with Docker. I think many people are starting to use containers, especially for Fuseki, which is a bit of a hassle to install natively (as shown in InstallTutorial). This could be a page in the Skosmos wiki. What do you think?

@mhabsaoui
Copy link
Author

mhabsaoui commented Oct 18, 2017

Hi,
Yep very good idea, letting those willing to start new fresh and fast hacks through docker containers 👍

Do I have to make a pull-request, asa I made the Docker way of Tutorial or what ?

@osma
Copy link
Member

osma commented Oct 18, 2017

I think the wiki here on GitHub allows anyone to edit pages. You could try creating a page for your tutorial. No need for pull requests, those are used for code contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants