Giter VIP home page Giter VIP logo

wikidata_reasoning's Introduction

Reasoning over Wikidata

what

Semantic reasoning over Wikidata.

why

Wikidata doesn't do reasoning/inference.

how

prepare

clone this repo.

build this docker image:

docker build --build-arg=uid=`id -u` --build-arg=gid=`id -g` -t justin2004/wikidata_reasoning .

start the docker container:

docker run --rm -it -v `pwd`:/mnt justin2004/wikidata_reasoning

usage

then you should find output.csv.

edit the sparql queries and save them and see the results propogate to output.csv.

e.g. see this row in output.csv

s,p,o
http://www.wikidata.org/entity/Q76,http://www.w3.org/1999/02/22-rdf-syntax-ns#type,http://www.wikidata.org/entity/Q5

which says that: president_obama rdf:type human

which is something that Wikidata does not say explictly but which is deriveable.

read Makefile to see what is going on.

logging

notice in the log output you see: 0/3, 1/3, 2/3, 3/3 in balloon letters. these indicate how far back in the dependency graph (that the makefile encodes) we had to go to produce the output.csv file.

notes

Although this repo uses Wikidata it could be adapted to other SPARQL endpoints.

Only RDFS reasoning is used currently but this could be extended to include OWL reasoning.

side benefit

This particular set of queries I think help address the criticism of Wikidata's Q numbers and P numbers.

Wikidata is essentially a giant obfuscated graph of nodes and edges. You have no idea of the semantic meaning of an edge without dereferencing the edge via a query or the wiki.

https://datalanguage.com/blog/wikidata-q41483

I think this reasoning helps because wdt:P31 (which people consider to be an obfsucated predicate) is rendered as rdf:type. Look in output.csv to see other non P number predicates.

wikidata_reasoning's People

Contributors

justin2004 avatar

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.