Autoindex are a set of REST API’s that aims to index various types of RDF data and also query it. It is currently a work in progress. A UI is also available for test under http://localhost:9091/.
Please go to the end of this ReadMe file for a simple demo of the UI.
Maven is the only pre-requisite. The instructions to install maven can be found here.
Once the maven is up and running. Clone the repository using the following command in a desired folder.
git clone https://github.com/dice-group/autoindex.git
Navigate to the base folder of the project and run the following command
mvn clean package
Run mvn clean spring-boot:run
Use test Website available under localhost:9091.
For docker, refer to the end of this file.
Index a Endpoint/File/Single Key value pair
http://localhost:9091/index.html
Get results for a label search or URI Search
http://localhost:9091/query.html
Create Index : /index/create Parameters : endPointParameters : {“url”:Valid End Point URL} , requestType : URI , userId : {if any} , useLocalDataSource : false (true to use a local Extraction data source) , default_graph : { if any}
If there are Select Queries to be modified or to know what default Select Queries would be executed, please refer below to Section “Customizing Select Queries”.
Create Index from File : Require Multipart Form data , API : /index/uploadFile Parameters: userId {if any}
CreateIndex From any Local Sparql End point: /index/create
Parameters : endPointParameters : {“url”:Valid LocalHost End Point URL} , useLocalDataSource : true
The Query passed would be executed as is on the Local End point URL. If you would prefer the Query present in application.properties to be executed, isEntityCustomized and entitySelectQuery can be ignored and not passed as parameter. Similar to Remote End Points, Local Sparql End points also support Query Customization and indexing of entity, classes and property ( either by default queries present under application.properties or by user provided custom queries). For custom queries, please refer to the section under “Customizing Select Queries”.
Add any single Custom key,value Pair: Parameters: requestType : custom, userId : {if any} , useLocalDataSource : false (true to use a local Extraction data source), a json field “keys” which takes {“firstKey: key , “secondKey”: value , “category”: (Entity,Property or Class) }
Search : /search Parameters: query : { Query to search} , type: {LABEL or URI}, userId : {if any and must match the id provided during createIndex} , category : {Either Entity , Class or Property}. For custom options which are supported by Search, please refer to section below under Section “Search Options”.
application.properties file contains options to edit/add new prefixes , modify existing select queries for entity,class and property by modifying entity.whereclause , class.whereclause and property.whereclause fields respectively.
To add new prefixes, go to the prefix list, add a new entry, both name and url are mandatory. If the last line in prefixes in configuration file is prefix4.url then you can add a new entry as prefix5.name and prefix5.url and so on.
Additionally, Select Queries can be customized through the Rest interface call of Indexing any EndPoint URL.
Create Index : /index/create Parameters : endPointParameters : {“url”:Valid End Point URL , “isEntityCustomized”: true , “isPropertyCustomized” : true , “isClassCustomized” : true , “entitySelectQuery” : Select Query for indexing Entities with necessary Prefixes , “propertySelectQuery” :Select Query for indexing Properties with necessary Prefixes , “classSelectQuery” : Select Query for indexing classes with necessary Prefixes} , requestType : URI , userId : {if any} , useLocalDataSource : false (true to use a local Extraction data source) , default_graph : { if any}.
Please note the following when there is a need to customize select Queries through Rest interfaces.
isEntityCustomized , isPropertyCustomized or isClassCustomized can be true when the user wants to overwrite the default Select Query with the select Query provided in the rest Interface. Please note it is mandatory to provide a value for entitySelectQuery when isEntityCustomized is passed as true. Similarly for properties and class Select Queries. By default, isEntityCustomized , isPropertyCustomized and isClassCustomized are optional and is assigned as false even if parameter is not passed.
Select Query for indexing Properties with necessary Prefixes : Select Queries provided should follow Sparql standards. Select Query is one complete text field which can also contain prefixes.
Prefixes should be of the form PREFIX key:
Support for Search Options would be similar to what is supported by Lucene and Elastic Search. These include
If there is a Eureka Server or other discovery client with which you want Auto Index to connect to, modify application.yml file as below: Change eureka.client.enabled to true and set serviceurl.defaultzone to the url of the eureka server to connect to. By default, AutoIndex has Discovery set to false and will not connect to any discovery client.
Please note Eureka Server must be running when eureka.client.enabled=true. Otherwise the application will not start and there would be a lot of errors from DiscoveryClient.
By connecting to eureka server, Auto Index behaves as a microservice and components can send Rest calls using http://AUTOINDEX.
First install docker in your system. For ubuntu you may refer to below link. [https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-16-04]
For windows users [https://docs.docker.com/toolbox/toolbox_install_windows/#step-1-check-your-version]
Move to the parent directory of project and execute the below commands
Now to build your image, type the below command.
sudo docker build -f Dockerfile -t autoindex_local .
To run your image, type the below command.
sudo docker run -d --restart=always -p 8186:9091 -t autoindex_local
To pull image from the hub,type the below command in terminal.
sudo docker run -d -p 8186:9091 dice-group/autoindex --restart always
docker image ls
docker container ps
docker container ps -a
Indexing RDF Data:
Search Options: