Setting up Cliopatria docker as lod server with w3id

Hello all,
This is one of these questions that crosses areas/tools.
I have written a schema for some data in linkml https://linkml.io/ and converted this to rdf. @cjm

I have a docker container with cliopatria ClioPatria running on my local machine.I have loaded my rdf file into cliopatria using the web interface. I now want to be able run a lod server.

I understand that I need to set up a handler:

:- http_handler('/rdf/',
                lod_api([ redirected_from('https://w3id.org/alspac/alspac-data-catalogue-schema')
                        ]),
                [ alspacdcs ]). %I assume this should be my prefix that I use for https://w3id.org/alspac/alspac-data-catalogue-schema in my rdf data?

Where should this handler code reside?

I have set up a dynamic dns to point to my local machine.

http://samneaves.ddns.net/

Once I have the handler code in the right place I then need to set the docker server to serve on port 80.

Do I then set up a .htaccess file on w3id github to be something like:

Header set Access-Control-Allow-Origin *
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$  http://samneaves.ddns.net/rdf/[R=303,L]

Is this right?

w3id says it uses https so will this work? or do I need to make cliopatria serve on https and port 22? Should I do this anyway? If so what is the bestway to start the docker container to serve https on what port? I assume I would then need to use something like lets encrypt to get keys and place them somewhere where the docker container can get to them? It’s been a while since I have played around with https so can’t remember the details.

Also would the handler code need to change if I need to set up a reverse proxy ?

Thanks for any help in getting this set up correctly.

Sam

Normally it is installed in config-enabled. And normally you set it up using

/path/to/ClioPatria/configure --with-lod ...

The will create config-enabled/lod.pl as a copy of the one on config-available in the sources. You can then edit the file to suit your needs. On startup, cliopatria reads all *.pl files from config-enabled.

Leave this prefix :slight_smile: It is an option to http_handler to indicate the handler must trigger on any location below /rdf/, not just on the location itself.

I know nothing about w3id. Sounds likely you need HTTPS support. The simplest way if you use Docker is probably to run a web server on the host with HTTPS enabled and proxy to the container. I typically use nginx for that if you have no web server yet. With w3id configured as you think it should, I guess you can check the access and error log to figure out what is expected.

Thanks for the info Jan very helpful as always.

I have tried using purl instead of w3id but its not working as I expect.

I have this code in a my config-enabled

:- http_handler('/rdf/',
                lod_api([ redirected_from('http://purl.org/alspac/alspac-data-catalogue-schema')
                        ]),
                [ prefix ]).

I have tried to set purl redirect as:

If I go to : http://purl.org/alspac/alspac-data-catalogue-schema/
I get redirect to the home page correctly but if I try

http://purl.org/alspac/alspac-data-catalogue-schema/ge_ht12_g1

I get a 404.

But I expected it to go here:
http://samneaves.ddns.net/browse/list_resource?r=http%3A//purl.org/alspac/alspac-data-catalogue-schema/ge_ht12_g1 ?
How is this meant to work and be set up?

I fixed this by setting the type of purl to partial :slight_smile:

1 Like