Defining endpoints in Virtuoso

2019-05-21 00:03发布

问题:

How can I define a new endpoints for my ontology in Virtuoso? I was able to upload my ontology via Virtuoso Conductor in the RDF Store Upload tab. Now I need to define a set of endpoints to be able to use them in my application via HTTP. Is there any tab in Virtuoso Conductor that implements a user friendly interface for creating an end point, and how can I do it? Do I need to use some external tool?

回答1:

Virtuoso's web server has the capability to create extra listeners using the conductor interface which is documented here:

http://docs.openlinksw.com/virtuoso/htmlconductorbar.html#admui.internetdomains

At install time you have your HTTP Server port in your virtuoso.ini set to 8890, which you want to keep in your local network as this contains ALL the endpoints that you have registered in Virtuoso. So as long as you do not open this port in your firewall, you can only get at it from the local machine.

Next you create a new vhost entry using the EXTERNAL name of your machine and use port 80 (or a higher port if you do not want to run as root) e.g:

Interface: 0.0.0.0 Port: 8080 Http Host: my.example.com

Next you add a "New directory to this line", click on "Type" radio button and choose "Sparql access point" from the dropdown list and press Next button. Set "Path" to /sparql and press the "Save Changes" button to store.

At this point you have created:

http://my.example.com:8080/sparql

which functions exactly the same as your internal http://localhost:8890/sparql . You can now open your firewall and allow outside machines to connect to port 8080 so people can use your sparql endpoint without access to any other endpoint on your virtuoso installation.

You should probably also change your virtuoso.ini so:

[URIQA] DefaultHost = my.example.com:8080

If you use port 80, you do not have to add :80 at the end of this setting, although it should not make any difference.

You can now add other directories / endpoints to the new my.example.com interface you just created e.g. a nice / directory that points to a index.html which describes your site etc.