Concept Of Nearest Neighbors

From an RDF Graph and a text file containing the target nodes, apply the Partitioning Algorithm to find the nearest neighbor
https://bitbucket.org/sebferre/conceptsofneighbours/

Parameters :

<rdfFilePath> <targetNodesFile> [--t=<time_limit>] [--d=<description_depth_limit>] [--v=<verbose_mode>]

The RDF File's format is automatically recognized, make sure it has the right extension
The text file must contain one URI per line, these URI will all be used for a different partition with the same parameters

Options

--d=<description_depth_limit> : How far from the target node a node must be at most to describe it. default=1
--t=<time_limit> : Sets a time limit for the algorithm in seconds. If set to 0, no time limit. default = 0. IT IS VERY DEPRECATED TO OMMIT THE TIME LIMIT.
--v=<verbose_mode> : Sets the level of verbosity :
* off : nothing is printed except the final result and error messages
* silent : during execution a line is printed at every iteration of the algorithm, this acts as a watcher to be sure that the algorithm isn't staggering
* verbose : during execution, the algorithm goes in great details to tell what it's doing

Results

Get the results of your partition in the results-<time>.json file created at the end of the algorithm

Examples

If you don't have a RDF file at your disposition, you can copy this inside a .ttl file :
@prefix : <http://example.org/royal/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
:man rdfs:subClassOf :human.
:woman rdfs:subClassOf :human.
:corgi rdfs:subClassOf :dog.
:human rdfs:subClassOf :living.
:dog rdfs:subClassOf :living.
:George a :man ;
:parent :William, :Kate .
:Harry a :man ;
:parent :Charles, :Diana.
:William a :man ;
:parent :Charles, :Diana.
:Charles a :man .
:Charlotte a :woman ;
:parent :William, :Kate .
:Kate a :woman .
:Diana a :woman .
:Vulcan a :corgi.
:Candy a :corgi.
and this into a .txt file :
http://example.org/royal/George
http://example.org/royal/Charlotte

In order to run a job you need to be identified or register a new account.

API Reference

The following curl command will create a job (note: job[webapp] is required, all other parameters are optional):

curl -H 'Authorization: Token token=<your private_token>' \
    -X POST https://allgo18.inria.fr/api/v1/jobs \
    -F 'job[webapp]=concept-of-nearest-neighbors' \
    -F 'job[version]=Stable-1908281152' \
    -F 'job[param]=' \
    -F 'job[queue]=standard' \
    -F 'files[0]=@test.txt' \
    -F 'files[1]=@test2.csv'

Monitor its progress:

curl -H 'Authorization: Token token=<your private_token>' \
    https://allgo18.inria.fr/api/v1/jobs/JOB_ID/events

Get the result:

curl -H 'Authorization: Token token=<your private_token>' \
    https://allgo18.inria.fr/api/v1/jobs/JOB_ID

Abort the job:

curl -H 'Authorization: Token token=<your private_token>' \
    -X POST https://allgo18.inria.fr/api/v1/jobs/JOB_ID/abort

Delete the job:

curl -H 'Authorization: Token token=<your private_token>' \
    -X DELETE https://allgo18.inria.fr/api/v1/jobs/JOB_ID