https://github.com/aksw/kbox

πŸ“¦ The Knowledge Box - A data dependency management framework to help users to publish, find and install data models

https://github.com/aksw/kbox

Science Score: 36.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • β—‹
    CITATION.cff file
  • βœ“
    codemeta.json file
    Found codemeta.json file
  • βœ“
    .zenodo.json file
    Found .zenodo.json file
  • β—‹
    DOI references
  • β—‹
    Academic publication links
  • βœ“
    Committers with academic emails
    2 of 15 committers (13.3%) from academic institutions
  • β—‹
    Institutional organization owner
  • β—‹
    JOSS paper metadata
  • β—‹
    Scientific vocabulary similarity
    Low similarity (9.4%) to scientific vocabulary

Keywords

dbpedia freebase java-api kbox knowledge-box knowledge-graph wikidata

Keywords from Contributors

cvode electricitymap graph-algorithms graph-theory neuroimaging notebook bioinformatics open-science opensnp differentialequations
Last synced: 6 months ago · JSON representation

Repository

πŸ“¦ The Knowledge Box - A data dependency management framework to help users to publish, find and install data models

Basic Info
Statistics
  • Stars: 47
  • Watchers: 29
  • Forks: 11
  • Open Issues: 19
  • Releases: 6
Topics
dbpedia freebase java-api kbox knowledge-box knowledge-graph wikidata
Created over 9 years ago · Last pushed 8 months ago
Metadata Files
Readme License

README.md

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.

2) Installing via pip:

  • Install via pip: pip install kbox

How can I execute KBox in command Line?

  • Type the following: ``` kbox [option] Where [command] is:
    • convert [] [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 [] gzip - encode a given file.
    • sparql (kb | server ) [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 (default 8080)] [subDomain (default kbox)] kb [install] - Start an SPARQL endpoint in the given subDomain containing the given bases.
    • server [port (default 8080)] [subDomain (default kbox)] rdf [install [install]] - Start an SPARQL endpoint in the given subDomain containing the given RDF files.
    • server [port (default 8080)] [subDomain (default kbox)] 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 - Install a given resource.
    • install kns - Install a given KNS service.
    • install kb [version ] - Install a given knowledge base using the available KNS services to resolve it.
    • install kb file - Install a given kb file in a given Kb-URL.
    • install kb kns [version ] - Install a knowledge base from a a given KNS service with the specific version.
    • install [install] kb rdf [version ] - Install a knowledge base from a a given RDF files with the specific version.
    • install kn [format [version ]] - Install a given knowledge base using the available KNS services to resolve it.
    • remove kns - Remove a given KNS service.
    • info format version ]] - Gives the information about a specific KB.
    • locate - returns the local address of the given resource.
    • locate kb version ] - returns the local address of the given KB.
    • locate kn format version ]] - returns the local address of the given KB.
    • search [format [version ]] [/p] - Search for all kb-URL containing a given pattern.
    • r-dir - Show the path to the resource folder.
    • r-dir - 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 withlist, install, remove, info, locate, search, r-dir & version` commands.

How can I use KBox with python?

  1. Install KBox pip package pip install KBox
  2. Import the kbox package (from kbox import kbox).
  3. 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> 2) 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> 3) 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

2) Pull KBox from AKSW hub repository. docker pull aksw/kbox

3) 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 |

```

4) 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 ;-) ...

5) 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 |

```

6) 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: marx@informatik.uni-leipzig.de

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.

Owner

  • Name: AKSW Research Group @ University of Leipzig
  • Login: AKSW
  • Kind: organization
  • Location: Leipzig

GitHub Events

Total
  • Watch event: 2
  • Pull request event: 1
Last Year
  • Watch event: 2
  • Pull request event: 1

Committers

Last synced: almost 3 years ago

All Time
  • Total Commits: 495
  • Total Committers: 15
  • Avg Commits per committer: 33.0
  • Development Distribution Score (DDS): 0.622
Top Committers
Name Email Commits
Edgard Marx m****x@i****e 187
Edgard Marx d****x@g****m 134
emarx e****x@l****m 115
sahandilshan s****g@g****m 37
Sahan Dilshan 3****m@u****m 7
Ciro Baron Neto c****o@g****m 4
dependabot[bot] 4****]@u****m 2
Konrad HΓΆffner k****r@u****e 2
Katrin Leinweber 9****r@u****m 1
Edgard Marx e****x@E****l 1
Tommaso Soru m****4@g****m 1
root r****t@d****s 1
The Gitter Badger b****r@g****m 1
s2it_scoelho s****o@u****m 1
Alfredo Serafini s****f@u****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 28
  • Total pull requests: 21
  • Average time to close issues: 5 months
  • Average time to close pull requests: 4 months
  • Total issue authors: 7
  • Total pull request authors: 8
  • Average comments per issue: 1.5
  • Average comments per pull request: 0.05
  • Merged pull requests: 13
  • Bot issues: 0
  • Bot pull requests: 9
Past Year
  • Issues: 0
  • Pull requests: 1
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 1
  • Average comments per issue: 0
  • Average comments per pull request: 0.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 1
Top Authors
Issue Authors
  • KonradHoeffner (12)
  • edgardmarx (6)
  • sahandilshan (4)
  • mommi84 (2)
  • omarsmak (2)
  • seralf (1)
  • cirola2000 (1)
Pull Request Authors
  • dependabot[bot] (10)
  • sahandilshan (4)
  • sandroacoelho (2)
  • KonradHoeffner (2)
  • gitter-badger (1)
  • katrinleinweber (1)
  • JLLeitschuh (1)
  • seralf (1)
Top Labels
Issue Labels
bug (4) enhancement (4) feature (2) main branch (1)
Pull Request Labels
dependencies (10) java (2) bug (1)

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 13 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 1
  • Total maintainers: 1
pypi.org: kbox

application will allow users to share and dereference ML models.

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 13 Last month
Rankings
Dependent packages count: 10.1%
Forks count: 10.5%
Stargazers count: 10.7%
Dependent repos count: 21.6%
Average: 27.5%
Downloads: 84.7%
Maintainers (1)
Last synced: 6 months ago

Dependencies

kbox.apple/pom.xml maven
  • org.aksw.kbox:kbox.core 0.0.2-alpha
  • org.apache.commons:commons-compress 1.19
kbox.core/pom.xml maven
  • org.apache.commons:commons-compress 1.19
  • org.mapdb:mapdb 2.0-beta13
  • org.zeroturnaround:zt-zip 1.13
kbox.core.test/pom.xml maven
  • junit:junit 4.8.1
  • org.aksw.kbox:kbox.core 0.0.2-alpha
kbox.fusca/pom.xml maven
  • org.apache.jena:jena-fuseki-server 3.9.0
kbox.kibe/pom.xml maven
  • com.googlecode.json-simple:json-simple 1.1
  • org.aksw.kbox:kbox.fusca 0.0.2-alpha
  • org.aksw.kbox:kbox.kns 0.0.2-alpha
  • org.apache.commons:commons-lang3 3.5
  • xerces:xercesImpl 2.10.0
kbox.kibe.test/pom.xml maven
  • junit:junit 4.8.1
  • org.aksw.kbox:kbox.kibe 0.0.2-alpha
kbox.kns/pom.xml maven
  • com.googlecode.json-simple:json-simple 1.1
  • org.aksw.kbox:kbox.apple 0.0.2-alpha
  • org.json:json 20180813
pom.xml maven
  • log4j:log4j 1.2.17
kbox.pip/requirements.txt pypi
  • click *
  • requests *
  • setuptools *
kbox.pip/setup.py pypi
  • click >=7.1.2
Dockerfile docker
  • java 8-jre build