Giter VIP home page Giter VIP logo

kbox's Introduction

KBox

Join the chat at https://gitter.im/AKSW/KBox Build Status Coverage Status Codacy Badge codebeat badge Join the chat at https://gitter.im/AKSW/KBox Project Stats

@InProceedings{Marx/KBox/ICSC/2017,
  Title                    = {{KBox}: {T}ransparently {S}hifting {Q}uery {E}xecution on {K}nowledge {G}raphs to the {E}dge},
  Author                   = {Edgard Marx and Ciro Baron and Tommaso Soru and S\"oren Auer},
  Booktitle                = {11th IEEE International Conference on Semantic Computing, Jan 30-Feb 1, 2017, San Diego, California, USA},
  Year                     = {2017}
}

KBox is an abbreviation for Knowledge Box. it is a data management framework designed to facilitate data deployment whether on the cloud, personal computers or smart devices (edge). KBox is designed to cover different aspects of data management. It can be used to describe how the data is built as well as its dependencies. The concept of a data management might be familiar to you if you are aware of software management tools such as npm for JavaScript, gem for Ruby, and NutGet for .NET. KBox is the option for data dependency management. The rationale behind KBox is to allow users to manage data dependency models for data-driven applications. That is, KBox helps you to publish as well as locate and install data models. Moreover, to make it easier to manage Knowledge Graphs, KBox has embedded one of the most popular RDF frameworks, Jena. With KBox users can natively share, deploy and query RDF Knowledge Graphs at scale.

Why use KBox?

Systems usually deal with resources and knowledge that are often duplicated among several instances. For instance, when using the Stanford NLP library the resources and knowledge inside the library are duplicated among different applications. The idea is to have a common repository where users can share resources without duplication. In order to do that, we bring the RDF concept to bridge the gap among resource publishing, storing and locating.

What is possible to do with it?

With KBox you can share resources and knowledge among several applications, but not just that. In order to allow an easier knowledge dissemination, we have implemented Kibe library. The Kibe library allows applications to virtually install and query RDF knowledge bases. It takes around ~50 minutes to start querying DBpedia on your computer to avoid server overheads and faults.

How can I use KBox?

You can use KBox either as a command-line program or a library in your application. It is easy to plug and use it.

Installing KBox

  1. Installing via runnable jar file:
  • Download the library here.
  1. Installing via pip:
  • Install via pip:
pip install kbox

How can I execute KBox in command Line?

  • Type the following:
kbox <command> [option]
Where [command] is:
   * convert <directory|file> [<destFile>] [kb|zip]	 - convert the content of a directory (default kb).
             kb	 - into a kb file. ps: the directory might contain only RDF compatible file formats.
             zip	 - into a zip file.
   * convert <file> [<destFile>] gzip	 - encode a given file.
   * sparql <query> (kb <KB> | server <URL>) [install] [-json]	 - Query a given knowledge base (e.g. sparql "Select ..." kb "KB1,KB2")
                                               	 - ps: use -install in case you want to enable the auto-dereference.
   * server [port <port> (default 8080)] [subDomain <subDomain> (default kbox)] kb <kb-URL> [install] 	 - Start an SPARQL endpoint in the given subDomain containing the given bases.
   * server [port <port> (default 8080)] [subDomain <subDomain> (default kbox)] rdf <directories|files> [install [install]]	 - Start an SPARQL endpoint in the given subDomain containing the given RDF files.
   * server [port <port> (default 8080)] [subDomain <subDomain> (default kbox)] target <target>	 - Start an SPARQL endpoint in the given subDomain containing the target RDF files.
   * list [/p]	 - List all available KNS services and knowledge bases.
   * list kns	 - List all available KNS services.
   * install <URL>	 - Install a given resource.
   * install kns <kns-URL>	 - Install a given KNS service.
   * install kb <kb-URL> [version <version>]	 - Install a given knowledge base using the available KNS services to resolve it.
   * install kb <kb-URL> file <kbFile>	 - Install a given kb file in a given Kb-URL.
   * install kb <kb-URL> kns <kns-URL> [version <version>]	 - Install a knowledge base from a a given KNS service with the specific version.
   * install [install] kb <kb-URL> rdf <directories|files> [version <version>]	 - Install a knowledge base from a a given RDF files with the specific version.
   * install kn <kn-URL> [format [version <version>]]	 - Install a given knowledge base using the available KNS services to resolve it.
   * remove kns <kns-URL>	 - Remove a given KNS service.
   * info <URL> format <format> version <version>]]	 - Gives the information about a specific KB.
   * locate <URL>	 - returns the local address of the given resource.
   * locate kb <kb-URL> version <version>]	 - returns the local address of the given KB.
   * locate kn <kn-URL> format version <version>]]	 - returns the local address of the given KB.
   * search <kn-URL-pattern> [format <format> [version <version>]] [/p]	 - Search for all kb-URL containing a given pattern.
   * r-dir	 - Show the path to the resource folder.
   * r-dir <resourceDir>	 - Change the path of the resource folder.
   * version 	 - display KBox version.

** Note: If you want to get the results of above commands as a JSON output, you can append -o json parameter at the end of each command.

Let's look at the list command as an example,

kbox list

KBox KNS Resource table list
##############################
name,format,version
##############################
http://purl.org/pcp-on-web/dbpedia,kibe,c9a618a875c5d46add88de4f00b538962f9359ad
http://purl.org/pcp-on-web/ontology,kibe,c9a618a875c5d46add88de4f00b538962f9359ad

When you append -o json parameter at the end, the result will be look like this,

kbox list -o json

{
    "status_code": 200,
    "message": "visited all KNs.",
    "results": [
        {
            "name": "http://purl.org/pcp-on-web/dbpedia",
            "format": "kibe",
            "version": "c9a618a875c5d46add88de4f00b538962f9359ad"
        },
        {
            "name": "http://purl.org/pcp-on-web/ontology",
            "format": "kibe",
            "version": "c9a618a875c5d46add88de4f00b538962f9359ad"
        }
    ]
}

This -o jsonsub command is only applicable with list, install, remove, info, locate, search, r-dir & version commands.

How can I use KBox with python?

  1. Install KBox pip package
pip install KBox
  1. Import the kbox package (from kbox import kbox).

  2. Execute any KBox command with execute() function as follows.

    kbox.execute('<kbox_command>')
    

**Note: execute() method will return a string output which contains the result of the executed command.

You can see more details about KBox python package from here

How can I use KBox in my project?

  • KBox is distributed over Maven.
  • You can add KBox to your project by importing the desired library:
  1. Add the following dependency on your project:
<dependency>
    	<groupId>org.aksw.kbox</groupId>
    	<artifactId>kbox.kibe</artifactId>
    	<version>v0.0.1-alpha3-RC16</version>
</dependency>
  1. Add the internal AKSW repository to your pom file:
<repositories>
    <repository>
      <id>maven.aksw.internal</id>
      <name>University Leipzig, AKSW Maven2 Repository</name>
      <url>http://maven.aksw.org/archiva/repository/internal</url>
    </repository>
  ...
</repositories>
  1. Rock it.. ;-)

How can I list available knowledge bases?

You can list the available knowledge graphs with list command:

kbox list
Knowledge base table list
http://dbpedia.org/3.9/en/full
http://dbpedia.org/3.9/en
http://dbpedia.org/2015-10/en
http://dbpedia.org/2015_10/en/full
http://dbpedia.org/2015-10/en/full
http://dbpedia.org/ontology
http://www.w3.org/1999/02/22-rdf-syntax-ns
https://www.w3.org/2000/01/rdf-schema
...

How can I query a published knowledge base?

Weeeelll... it's quite easy. Remember the commands listed on 'How can I execute KBox in command Line'. It's just about executing the command line below. Remember to add -install, so the knowledge base is automatically dereferenced.

kbox sparql "Select (count(distinct ?s) as ?n) where {?s ?p ?o}" kb "https://www.w3.org/2000/01/rdf-schema" install
------
| n  |
======
| 32 |
------

Or using the java API...

KBox.query("Select (count(distinct ?s) as ?n) where {?s ?p ?o}", true, new URL("https://www.w3.org/2000/01/rdf-schema"));

You might want to setup the model before starting to execute multiple queries on it:

Model model = KBox.createModel(new URL("https://www.w3.org/2000/01/rdf-schema"));
KBox.query("Select (count(distinct ?s) as ?n) where {?s ?p ?o}", model);

How can I query multi-bases?

It's very easy, as you just need to add the knowledge base you want to query separated by commas as the command below:

In the given example, we query two knowledge bases, https://www.w3.org/2000/01/rdf-schema and http://xmlns.com/foaf/0.1.

kbox sparql "Select (count(distinct ?s) as ?n) where {?s ?p ?o}" kb "https://www.w3.org/2000/01/rdf-schema,http://xmlns.com/foaf/0.1" install
-------
| n   |
=======
| 123 |
-------

Or using the java API...

KBox.query("Select (count(distinct ?s) as ?n) where {?s ?p ?o}", 
                   true, new URL("https://www.w3.org/2000/01/rdf-schema"), 
                   new URL("http://xmlns.com/foaf/0.1"));

You might want to setup the model before starting to execute multiple queries on it:

Model model = KBox.createModel(new URL("https://www.w3.org/2000/01/rdf-schema"),
                   new URL("http://xmlns.com/foaf/0.1"));
KBox.query("Select (count(distinct ?s) as ?n) where {?s ?p ?o}", model);

Starting a SPARQL endpoint

Yes, you can!!

kbox server kb "https://www.w3.org/2000/01/rdf-schema,http://xmlns.com/foaf/0.1" install
Loading Model...
Publishing service on http://localhost:8080/kbox/query
Service up and running ;-) ...

If you successfully instantiate your server, now you can access the web client at http://localhost:8080 as shown bellow:

KBox client

Querying a SPARQL endpoint

by console

kbox server "http://localhost:8080/kbox/query" sparql "Select (count(distinct ?s) as ?n) where {?s ?p ?o}"
-------
| n   |
=======
| 123 |
-------

or JAVA API

URL url = new URL("Select (count(distinct ?s) as ?n) where {?s ?p ?o}");
ServerAddress serverURL = new ServerAddress("http://localhost:8080/kbox/query");
try(ResultSet rs = KBox.query(sparql, serverURL);) { // do not forget to close the result set.
...
}

Listing the resource folder

kbox r-dir
Your current resource directory is: kbox/dir/path

Changing the resource folder

You might get problems with permissions using KBox in shared environments. Therefore, you can change the resource directory of KBox to your desired one.

kbox r-dir new/path

Using KBox with Docker

You can also use KBox Docker container by following the steps below:

  1. Install Docker in your machine (Consult the guide for more details).
sudo apt-get update
sudo apt-get -y install docker-engine
  1. Pull KBox from AKSW hub repository.
docker pull aksw/kbox
  1. Run it...
docker run aksw/kbox sparql "Select (count(distinct ?s) as ?n) where {?s ?p ?o}" kb "https://www.w3.org/2000/01/rdf-schema" install
------
| n  |
======
| 32 |
------
  1. Start a server using docker:
docker run -p 8080:8080 aksw/kbox server kb "https://www.w3.org/2000/01/rdf-schema" install
Loading Model...
Publishing service on http://localhost:8080/kbox/query
Service up and running ;-) ...
  1. You can also query your endpoint from a KBox docker container, but do not forget to use the '--network host' flag:
docker run --network host aksw/kbox -sparql "Select ?s {?s ?p ?o} limit 5" -server "http://localhost:8080/kbox/sparql"
------
| n  |
======
| 32 |
------
  1. You can also cache the installed knowledge bases, so you don't need to download them multiple times:
mkdir my-cache-dir/.kbox
docker run  --name kbox --mount type=bind,source=my-cache-dir/.kbox,target=/root/.kbox aksw/kbox -server -kb "https://www.w3.org/2000/01/rdf-schema"  -install

How can I publish my own Dataset?

Although you can create your own KNS service and publish your datasets, currently KBox does not allow you to directly publish content to make them available to other users. In order to do that, you must contact us.

Contact: [email protected]

Information needed:

  1. Dataset Label;
  2. Dataset Version;
  3. The Publisher: Your or your organization's email/URL;
  4. The Creator: Who has created the Knowledge base, e.g. DBpedia -> http://dbpedia.org;
  5. The License: the dataset license;
  6. The URL where the Knowledge graph file can be dereference (please create the file using KBox createIndex command);
  7. The Dataset URI name: the URI name that will be used by users to dereference your dataset;
  8. The Dataset description: Give us a few words to help others to know what your dataset is about;
  9. Tell us one reason why KBox is awesome. :-)

How can I create my own custom build(.jar) of KBox?

If you want to do some modifications or changes to the KBox and want to use the KBox with those modifications, you have to create your own custom build (jar). To do that follow these steps,

  1. Open a terminal on the KBox home directory
  2. Issue the following command in the terminal to build the project. mvn clean install
  3. Then navigate to kbox.kibe/target directory
  4. In there you will be able to see a jar file named similar to kbox.kibe-x.x.x-........-jar-with-dependencies.jar
  5. This is the jar that contains all the modifications you did.

kbox's People

Contributors

cirola2000 avatar dependabot[bot] avatar edgardmarx avatar gitter-badger avatar katrinleinweber avatar konradhoeffner avatar mommi84 avatar sahandilshan avatar seralf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kbox's Issues

Error "java.io.EOFException: Unexpected end of ZLIB input stream"

Hello team,

I have managed to download DBpedia 2015_10 using kbox, however after it finished downloading started to install, it produced the following error in the logs:

22:43:09 10 May 2017 - [main] ERROR org.aksw.kbox.kibe.Main  - Error installing the Knowledge Bases.
org.askw.kbox.kns.exception.ResourceDereferencingException: The resource http://dbpedia.org/2015_10/en/full could not be derecerenced.
        at org.aksw.kbox.kns.KBox.getResource(KBox.java:267)
        at org.aksw.kbox.kibe.KBox.getKowledgebases(KBox.java:700)
        at org.aksw.kbox.kibe.KBox.createModel(KBox.java:686)
        at org.aksw.kbox.kibe.Main.main(Main.java:380)
Caused by: java.io.EOFException: Unexpected end of ZLIB input stream
        at java.util.zip.InflaterInputStream.fill(InflaterInputStream.java:240)
        at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:158)
        at java.util.zip.ZipInputStream.read(ZipInputStream.java:194)
        at java.io.BufferedInputStream.fill(BufferedInputStream.java:246)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:286)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:345)
        at java.io.FilterInputStream.read(FilterInputStream.java:107)
        at org.aksw.kbox.utils.ZIPUtil.copy(ZIPUtil.java:78)
        at org.aksw.kbox.utils.ZIPUtil.copy(ZIPUtil.java:91)
        at org.aksw.kbox.utils.ZIPUtil.unzip(ZIPUtil.java:106)
        at org.aksw.kbox.apple.ZipAppInstall.install(ZipAppInstall.java:21)
        at org.aksw.kbox.apple.AbstractInstall.install(AbstractInstall.java:28)
        at org.aksw.kbox.apple.KBox.install(KBox.java:92)
        at org.aksw.kbox.kns.KBox.getResource(KBox.java:265)
        ... 3 more

KBox not showing the current version nor helping commands in the terminal

Description:

  • -version command not showing the current version of the KBox
  • Helping commands not showing when a user enters a wrong command

Steps to reproduce:

  • Issue the following command to get the version of the KBox, java -jar kbox.jar -version. Nothing will be printed on the terminal
    image

  • Issue any wrong command in the terminal, java -jar kbox.jar -lisst. Nothing will be printed.
    image

how to publish a dataset for local testing?

HI
I wonder if it's possible to test the service with my own RDF data locally: I mean creating a small knowledge base and expose it by SPARQL.
Reading at "Although you can create your own KNS service and publish your datasets,..." it seems possible but following the README and the usage from command line I don't understand how.
For example the indexing of files in a directory does something and create a .kb file, but I'm not sure if I have to use this file in some way for exposing it by SPARQL?

thanks for any advice/suggestion

test failures

mvn package on master:

Tests run: 32, Failures: 0, Errors: 5, Skipped: 0, Time elapsed: 10.232 sec <<< FAILURE!
testResolveURLWithKBoxKNSService(org.aksw.kbox.kibe.KBoxTest)  Time elapsed: 0.261 sec  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "org.aksw.kbox.kns.KN.getTargets()" because "resolvedKN" is null
	at org.aksw.kbox.kibe.KBoxTest.testResolveURLWithKBoxKNSService(KBoxTest.java:145)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testResolveKNS(org.aksw.kbox.kibe.KBoxTest)  Time elapsed: 0.002 sec  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "org.aksw.kbox.kns.KN.getTargets()" because "resolvedKN" is null
	at org.aksw.kbox.kibe.KBoxTest.testResolveKNS(KBoxTest.java:159)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testResolveKNS2(org.aksw.kbox.kibe.KBoxTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "org.aksw.kbox.kns.KN.getTargets()" because "resolvedKN" is null
	at org.aksw.kbox.kibe.KBoxTest.testResolveKNS2(KBoxTest.java:167)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testResolveKN(org.aksw.kbox.kibe.KBoxTest)  Time elapsed: 0.001 sec  <<< ERROR!
java.lang.NullPointerException: Cannot invoke "org.aksw.kbox.kns.KN.getNameTags()" because "resolvedKN" is null
	at org.aksw.kbox.kibe.KBoxTest.testResolveKN(KBoxTest.java:67)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

testGetResource(org.aksw.kbox.kibe.KBoxTest)  Time elapsed: 0.017 sec  <<< ERROR!
org.aksw.kbox.kns.exception.ResourceNotResolvedException: http://test.org/5MB.zip
	at org.aksw.kbox.kns.KBox.getResource(KBox.java:362)
	at org.aksw.kbox.kns.KBox.getResource(KBox.java:248)
	at org.aksw.kbox.kns.KBox.getResource(KBox.java:214)
	at org.aksw.kbox.kns.KBox.getResource(KBox.java:313)
	at org.aksw.kbox.kns.KBox.getResource(KBox.java:281)
	at org.aksw.kbox.kibe.KBoxTest.testGetResource(KBoxTest.java:93)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
	at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
	at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
	at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:104)
	at java.base/java.lang.reflect.Method.invoke(Method.java:577)
	at org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
	at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
	at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Running org.aksw.kbox.kibe.tdb.TDBTest
1
4
1
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 1.032 sec

Results :

Tests in error: 
  testResolveURLWithKBoxKNSService(org.aksw.kbox.kibe.KBoxTest): Cannot invoke "org.aksw.kbox.kns.KN.getTargets()" because "resolvedKN" is null
  testResolveKNS(org.aksw.kbox.kibe.KBoxTest): Cannot invoke "org.aksw.kbox.kns.KN.getTargets()" because "resolvedKN" is null
  testResolveKNS2(org.aksw.kbox.kibe.KBoxTest): Cannot invoke "org.aksw.kbox.kns.KN.getTargets()" because "resolvedKN" is null
  testResolveKN(org.aksw.kbox.kibe.KBoxTest): Cannot invoke "org.aksw.kbox.kns.KN.getNameTags()" because "resolvedKN" is null
  testGetResource(org.aksw.kbox.kibe.KBoxTest): http://test.org/5MB.zip

Tests run: 35, Failures: 0, Errors: 5, Skipped: 0

[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for kbox 0.0.2-alpha:
[INFO] 
[INFO] kbox ............................................... SUCCESS [  1.262 s]
[INFO] kbox.core .......................................... SUCCESS [  3.259 s]
[INFO] kbox.core.test ..................................... SUCCESS [  1.521 s]
[INFO] kbox.apple ......................................... SUCCESS [  0.130 s]
[INFO] kbox.kns ........................................... SUCCESS [  0.644 s]
[INFO] kbox.fusca ......................................... SUCCESS [  2.244 s]
[INFO] kbox.kibe .......................................... SUCCESS [  4.777 s]
[INFO] kbox.kibe.test ..................................... FAILURE [ 11.520 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  25.422 s
[INFO] Finished at: 2022-04-13T16:33:02+02:00
[INFO] ------------------------------------------------------------------------

Cannot start server

Here are my commands:

$ java -Xmx1g -jar kbox-v0.0.1-alpha3.jar -createIndex linkedmdb/
Creating index.
Index created.
$ java -Xmx1g -jar kbox-v0.0.1-alpha3.jar -install -kb http://linkedmdb.org -index kbox.kb 
Installing KB http://linkedmdb.org
Installing 100% [====================>] 100/100, ETA: 00:00:00
KB installed.

At this point I can see the index in my local .kbox folder, which I did not set to ~/.kbox, but to another location.

$ java -Xmx1g -jar kbox-v0.0.1-alpha3.jar -server -graph "http://linkedmdb.org"
Error installing Knowledge Graphs.
The Knowledge Graph could not be found.

(Feature) Repo Sync

Create feature for synchronising an existing repository with a given one.

An error occurred while creating the index: null

The folder contains exactly one syntactically correct Turtle file:

/tmp$ du -hs snik/*
3.6M	snik/snik.ttl
/tmp$ rapper -i turtle -c snik/snik.ttl 
rapper: Parsing URI file:///tmp/snik/snik.ttl with parser turtle
rapper: Parsing returned 81494 triples

createIndex throws an error:

/tmp$ docker run aksw/kbox -createIndex snik
Creating index.
An error occurred while creating the index: null

-remove command not working

Description:
As the documentation says -remove -kns <kns-URL> should remove the provided kns from the KBox. But it won't work as expected since the provided URL will not fetch from the KBox. It will always set the URL to a Null value.

String knsURL = getSingleParam(commands, REMOVE_COMMAND);

This line here is responsible for fetching the URL from the command. It will get the URL from the command map using the -remove key. The problem is that the URL does not exist on the -remove key, instead it is exists under the -kns key.

image

Steps to reproduce:
Use the -remove command exactly as provided in the documentation -remove -kns <kns-URL>

Possible solutions.
There are two possible solutions to fix this issue.

  1. Ignore the format of the remove command which is provided in the documentation (-remove -kns <kns-URL>) and follow this format -remove <kns-URL> -kns
  2. Use the KNS_COMMAND instead of the REMOVE_COMMAND in the following line
    String knsURL = getSingleParam(commands, REMOVE_COMMAND);

Implement alteration date check

This feature is regarding the check of the alteration time of the target data.
When a change is detected in the target data, the system should automatically update the graph.

Wrong service link for the browser

docker run -p 8080:8080 aksw/kbox -server -kb "http://www.snik.eu/ontology" -install
Loading Model...
Installing  99% [===================> ]  [2579465/2580713] ETA: 00:00:01
Publishing service on http://localhost:8080/kbox/query
Service up and running ;-) ..

But http://localhost:8080/kbox/query returns a 404 error: Error 404: Service Description: /kbox/query.
The correct URL seems to be http://localhost:8080/, please correct the link.

ArrayIndexOutOfBoundsException: 2 at org.aksw.kbox.kibe.Main.parse(Main.java:573)

$ docker run aksw/kbox -version
KBox version v0.0.2-alpha
docker run aksw/kbox -sparql "SELECT (COUNT(*) AS ?count) {?s ?p ?o.}" -kb "http://www.snik.eu/ontology" -install
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 2
	at org.aksw.kbox.kibe.Main.parse(Main.java:573)
	at org.aksw.kbox.kibe.Main.main(Main.java:77)

-list command not listing Knowledge Bases

Description:
java -jar kbox.jar -list command not listing down the installed knowledge bases

OS, other environment details and versions:
JDK version: 1.8
OS: Windows

Steps to reproduce:

  1. Add a kns via following command *java -jar kbox.jar -install -kns
  2. Then list down all kns to make sure that it was installed. (java -jar kbox.jar -list -kns)
  3. Then use the following command to list all knowledge bases, java -jar kbox.jar -list)
    image

Docker always forgets what it installed

Using aksw/kbox:v0.0.2-alpha, I have to -install the same knowledge base every time I run the container. Please cache the results in order to save time and bandwidth.

Error installing the Knowledge Bases.

Hello,

I was trying to run a DBepdia server using this command:

java -jar kbox-v0.0.1-alpha3-RC16.jar -server -kb http://dbpedia.org/3.9/en/full -install

But I got the following error:

WARNING: Closing storage with uncommited data, this data will be discarded.
Error installing the Knowledge Bases.

Thought it only worked with one KB : http://linkedmdb.org

Not found: file:/./sbin/

kbox produces an error when calling createIndex with the current directory as a relative path:

$ docker run aksw/kbox -createIndex .
Creating index.
An error occurred while creating the index: Not found: file:/./sbin/

kbox list missing hyphen in readme

The readme says:

You can list the available knowledge graphs with list command: kbox list

However it only works with a hypen in version v0.0.2-alpha: kbox -list. Please update the readme.

kbox -info doesn't provide all information

According to the readme, all datasets need to have the following descriptors: Publisher, Creator, License, KB URL, Dataset URI name and Dataset description.

However whenever I use kbox -info, it only gives me KNS, KB and description.
It would be nice if it would show the values for other fields as well, as publisher, creator and license are missing.

Example

$ kbox -info http://xmlns.com/foaf/0.1 
KNS:https://raw.github.com/AKSW/kbox/master
KB:http://xmlns.com/foaf/0.1
Description:This dataset contains the FOAF ontology.

Support for Describe queries

Currently, DESCRIBE queries aren't supported.

$ java -Xmx8g -jar kbox-v0.0.1-alpha2.jar -sparql "DESCRIBE <http://dbpedia.org/resource/Tom_Jones_(singer)>" -graph "http://dbpedia.org/2015-10/en/full"
11:53:23 19 Dec 2016 - [main] INFO  org.aksw.kbox.kibe.KBox  - Error exectuting query.
com.hp.hpl.jena.query.QueryExecException: Attempt to have ResultSet from a DESCRIBE query
	at com.hp.hpl.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:182)
	at org.aksw.kbox.kibe.tdb.TDB.query(TDB.java:47)
	at org.aksw.kbox.kibe.tdb.TDB.query(TDB.java:23)
	at org.aksw.kbox.kibe.KBox.query(KBox.java:427)
	at org.aksw.kbox.kibe.KBox.main(KBox.java:120)

One can use this instead:

SELECT * WHERE {
    { <http://dbpedia.org/resource/Tom_Jones_(singer)> ?p ?o }
    UNION { ?s ?p <http://dbpedia.org/resource/Tom_Jones_(singer)> }
}

Can't stop docker

$ docker run -p 8080:8080 aksw/kbox -server -kb "http://www.snik.eu/ontology" -install
Loading Model...
Installing  99% [===================> ]  [2579465/2580713] ETA: 00:00:01
Publishing service on http://localhost:8080/kbox/query
Service up and running ;-) ...

Now I can't stop it with CTRL+C. I need docker kill in another window to stop it.
Version v0.0.2-alpha.

-createIndex does not exist anymore in v0.0.2-alpha

README.md says I should use kbox -createIndex but that command doesn't exist anymore in version v0.0.2-alpha as installed via pip. What should I use instead, convert? Please update the readme with an example on how the current method works.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.