45
Navigate *All* the Knowledge Navigate *All* the Knowledge Getting started with ConceptMap.io Getting started with ConceptMap.io James L. Weaver Developer Advocate Twitter: @JavaFXpert Email: [email protected] http://JavaFXpert.com http://CulturedEar.com http://ConceptMap.io

GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Embed Size (px)

Citation preview

Page 1: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Navigate *All* the KnowledgeNavigate *All* the KnowledgeGetting started with ConceptMap.ioGetting started with ConceptMap.io

James L. WeaverDeveloper Advocate Twitter: @JavaFXpertEmail: [email protected]://JavaFXpert.comhttp://CulturedEar.com

http://ConceptMap.io

Page 2: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

About the PresenterAbout the Presenter

Java Champion, JavaOne Rockstar, plays well with others, etc :-)

Author of several Java/JavaFX/RaspPi books

Page 3: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

App is live at App is live at ConceptMap.ioConceptMap.io

ConceptMap.io source code for services and UI:

Open source, licensed under the Apache License, Version 2.0

https://github.com/JavaFXpert/wikibrowser-service

Note: These Technical Presentation slides are available at

as well as by clicking the Help button in http://slides.com/javafxpert/conceptmap-technical

ConceptMap.io

Page 4: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Wikimedia has many projectsWikimedia has many projects

Graphic from presentation by Lynda Pintscher

Page 5: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

... the most famous is Wikipedia... the most famous is Wikipedia

Graphic from 2013 presentation by Lynda Pintscher

Page 6: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Graphic from 2013 presentation by Lynda Pintscher

Wikimedia CommonsWikimedia CommonsMedia files leveraged by Wikimedia projects

Page 7: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Graphic from 2013 presentation by Lynda Pintscher

WikidataWikidataCentral storage for the structured data of Wikimedia projects

Page 8: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Graphic from 2013 presentation by Lynda Pintscher

WikidataWikidataProvides semantic structure for Wikipedia articles in any language

Page 9: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Wikipedia + WikidataWikipedia + WikidataWikipedia articles and their relationships to each other

Page 10: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

The Big Idea: The Big Idea: ConceptMap.ioConceptMap.ioNavigate/pin Wikipedia articles via links and Wikidata relationships

Page 11: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Designed to facilitate:Designed to facilitate:

Learning

Teaching

Research

Page 12: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioSearch for an item and pin it to the concept map

Page 13: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioSelect a link in the Wikipedia article

Page 14: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioPin the item to the concept map

Page 15: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioSelect an item in the map, expand a relationship, and select an item

Page 16: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioPin the item to the concept map

Page 17: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioSelect an item in the map, and click the [x1] button for a relationship

Page 18: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioThe [x1] button pinned the items found at the first level of the relationship

Page 19: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioSelect an item in the concept map, and select an item From Related Items

Page 20: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioPin the item to the concept map

Page 21: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioContinue selecting items from Wikipedia articles and Wikidata Relationships

Page 22: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching Scenario... and pin them to the concept map

Page 23: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioEdit relationships for an item by selecting Wikidata icon

Page 24: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioWikidata page appears with which anyone may edit the item's info

Page 25: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioSelect the Link icon to create a link to the concept map

Page 26: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Learning/Teaching ScenarioLearning/Teaching ScenarioShare the link to your concept map with a colleague or student

Page 27: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

ConceptMap.ioConceptMap.ioHigh-level view of distributed architecture

Page 28: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Search for EarthUse case: Search for Earth

Page 29: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Pin Earth to graphUse case: Pin Earth to graph

Page 30: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Resource controllerResource controllerhttp://example/graph?items=Q2,Q405,Q525

Note: Because is on the classpath,Spring’s is automatically

chosen to convert the GraphResponseNear instance to JSON

Jackson 2MappingJackson2HttpMessageConverter

@RestControllerpublic class WikiGraphController { @RequestMapping(value = "/graph", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE public ResponseEntity<Object> search(@RequestParam(value = "items", defaultValue="") String items) { GraphResponseNear graphResponseNear = null; ... return Optional.ofNullable(graphResponseNear) .map(cr -> new ResponseEntity<>((Object)cr, HttpStatus.OK)) .orElse(new ResponseEntity<>("Graph query unsuccessful", HttpStatus.INTERNAL_SERVER_ERROR)); }}

To learn more, see Spring GuideBuilding a RESTful Web Service

Page 31: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

http://example/graph?items=Q2,Q405,Q525

MATCH (a:Item), (b:Item)WHERE a.itemId IN ['Q2', 'Q405', 'Q525'] AND b.itemId IN ['Q2', 'Q405', 'Q525']WITH a, bOPTIONAL MATCH (a)-[rel]-(b)RETURN a, b, collect(rel)

Neo4j Cypher queryNeo4j Cypher query(find all relationships between pinned items)

Page 32: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Resource representationResource representationpublic class Item { private String type; private String id;

public Item() { }

public String getType() { return type; }

public void setType(String type) { this.type = type; }

public String getId() { return id; }

public void setId(String id) { this.id = id; }}

Page 33: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Change languageUse case: Change language

Page 34: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Share linkUse case: Share link

Page 35: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Breadth-first searchUse case: Breadth-first search(expand items related by a given property to a given depth)

Page 36: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Items in commonUse case: Items in common

Text

(all shortest paths, two hops or less)

Page 37: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Neo4j Cypher queryNeo4j Cypher query

http://example/visshortpaths?id=Q111&target=Q313

MATCH p=allShortestPaths( (a:Item {itemId:'Q111'})-[*..2]-(b:Item {itemId:'Q313'}) )RETURN p LIMIT 200

(all shortest paths, two hops or less)

Page 38: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Navigate to rootUse case: Navigate to root(shortest path to Entity using subclass of, instance of, part of)

Page 39: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Neo4j Cypher queryNeo4j Cypher query

http://example/visrootpaths?id=Q332

MATCH p=shortestPath( (a:Item {itemId:'Q332'})-[*]->(b:Item {itemId:'Q35120'}) )WHERE NONE(x IN RELATIONSHIPS(p) WHERE (x.propId <> 'P279') AND (x.propId <> 'P31') AND (x.propId <> 'P361'))RETURN p

(shortest path to Entity using subclass of, instance of, part of)

Page 40: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Use case: Degrees of separationUse case: Degrees of separation

Text

(shortest path, like Kevin Bacon game)

Page 41: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Make the app executableMake the app executable

package com.javafxpert.wikibrowser;

import org.springframework.boot.SpringApplication;import org.springframework.boot.autoconfigure.SpringBootApplication;import org.springframework.boot.context.properties.EnableConfigurationProperties;

@EnableConfigurationProperties@SpringBootApplicationpublic class WikiBrowserServiceApplication {

public static void main(String[] args) { SpringApplication.run(WikiBrowserServiceApplication.class, args); }}

To learn more, see Spring GuideBuilding a RESTful Web Service

Page 42: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

App build/deploy cycleApp build/deploy cycle

1. $ mvn clean install2. $ cf push -p ./target/wikibrowser-service.jar ConceptMap

Note: One method of deployment for Spring Boot apps is a JARfile, which contains an embedded Tomcat servlet container.

Page 43: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Pivotal Web Services ConsolePivotal Web Services Console

Page 44: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

start.spring.iostart.spring.io

Page 45: GraphConnect Europe 2016 - Navigating All the Knowledge - James Weaver

Navigate *All* the KnowledgeNavigate *All* the KnowledgeConceptMap.io from a technical perspectiveConceptMap.io from a technical perspective

James L. WeaverDeveloper Advocate Twitter: @JavaFXpertEmail: [email protected]://JavaFXpert.comhttp://CulturedEar.com

http://ConceptMap.io

Hope you enjoyed