Coder Social home page Coder Social logo

angryloki / wikidata-graph-builder Goto Github PK

View Code? Open in Web Editor NEW
187.0 10.0 24.0 2.22 MB

Visualize Wikidata items using d3.js

Home Page: https://angryloki.github.io/wikidata-graph-builder/

License: MIT License

HTML 0.22% CSS 0.04% JavaScript 1.13% Svelte 49.09% TypeScript 49.52%
wikidata d3 angularjs visualisation

wikidata-graph-builder's Introduction

Visualize Wikidata items using d3.js.

Main features

Developing

Once you've created a project and installed dependencies with pnpm install, start a development server:

npm run dev

# or start the server and open the app in a new browser tab
npm run dev -- --open

Building

To create a production version of your app:

npm run build

You can preview the production build with npm run preview.

wikidata-graph-builder's People

Contributors

angryloki 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  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  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

wikidata-graph-builder's Issues

Connect it to wikibase?

Hello,

Is it easy to connect it to another wikibase instance?
I understand it depends on the wikidata query service (sparql) so it's maybe possible to change the URL of the sparql endpoint somewhere?

Thanks for any help.

regards

Limit items to the ones with English Wikipedia pages?

Load a TTL or RDF file?

I really love this tool. Using it extensively to understand Wikidata class trees, such as this one:

image

I have a local RDF file that I'd like to use this app for. Is there any way I can tweak it to read a local RDF file like this?

:Disease rdfs:subClassOf:Thing .
:DiseaseGeneAssociation rdfs:subClassOf :Disease .

Any pointers would be really helpful!

Thanks!

Add the ability to filter or partition nodes as a function of other properties

This is a fantastic tool, thanks for releasing it (you're getting quite a lot of love on social media (1 - 2).

It would be really great to add the following two options:

  • filter the graph by some other (property,value) pair. For example, I'd love to be able to clean up this graph and only display nodes that are an instance of a state.
  • partition nodes by some other (property,value) pair. For example it would be great to group these nodes/subgraphs as a function of country)

Difference between Wikidata Graph Builder and WDQS

I have this Wikidata query:

SELECT ?root_name ?parent_name ?child_name WHERE
{
 VALUES ?root_name {"Brassica rapa"}
 ?root wdt:P225 ?root_name .
 ?child wdt:P171+ ?root .
 ?child wdt:P171 ?parent .
 ?child wdt:P225 ?child_name .
 ?parent wdt:P225 ?parent_name .
 SERVICE wikibase:label {bd:serviceParam wikibase:language "en" }
}

serialized here:
https://query.wikidata.org/#SELECT%20%3Froot_name%20%3Fparent_name%20%3Fchild_name%20WHERE%0A%7B%0A%20VALUES%20%3Froot_name%20%7B%22Brassica%20rapa%22%7D%0A%20%3Froot%20wdt%3AP225%20%3Froot_name%20.%0A%20%3Fchild%20wdt%3AP171%2B%20%3Froot%20.%0A%20%3Fchild%20wdt%3AP171%20%3Fparent%20.%0A%20%3Fchild%20wdt%3AP225%20%3Fchild_name%20.%0A%20%3Fparent%20wdt%3AP225%20%3Fparent_name%20.%0A%20SERVICE%20wikibase%3Alabel%20%7Bbd%3AserviceParam%20wikibase%3Alanguage%20%22en%22%20%7D%0A%7D

When using
display results: treemap
WD produces a structured hierarchy

Similarly
display results: dimensions
plots the tree

When I use the above query on Wikidata Graph Builder, I see the error message
Unable to load graph data
me.item is undefined

Is this user-error?
Is there a working WGB query that will display the child items for the parent root_name?

Thanks for advice here.
/jay

Traverse subproperties

It would be nice to traverse not only the given property but also its subproperties.

For example, if I want to know the dependencies of a software, traversing depends on software (P1547) will miss dependencies tagged using a more specific subproperty, e.g. GUI toolkit or framework (P1414). Going one level above, traversing uses (P2283) will miss both P1547 and P1414.

This could be controlled by a checkbox labeled e.g. "Traverse subproperties", as the current behavior might sometimes be desired.

Reasons to choose canvas?

Hi, we are considering to migrate to elkjs from dagre. I saw your comment(kieler/elkjs#141 (comment)), this is great demonstration for us. I'm wondering why did you choose the canvas for rendering rather than svg? Since we need to support animations in our graph, svg is proper choice for us due to ease of css-transition. But I want to know are there any limitation that blocking svg or advantages when using canvas. Thank you!

problem building a graph

May I ask for your help with a query that we'd like to present in wikidata-graph-builder?
We have this query:

SELECT ?item ?itemLabel ?linkTo ?linkToLabel WHERE {
  ?item wdt:P166 wd:Q37922 ;
        wdt:P910 wd:Q8064684 .
  OPTIONAL {
    ?linkTo wdt:P166 wd:Q37922 ;
            wdt:P31 wd:Q5 } .
 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

that can be seen here

But the structure of the query does not support a 'hedgehog' type graph illustrating the relationship between Dylan and other winners of the Nobel Prize in Literature, as shown here

How should we redesign the query so that the relationships are illustrated in wikidata-graph-builder?

Thanks for help here.

/jay gray

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.