James L. Weaver
Developer Advocate
Twitter: @JavaFXpert
Email: jweaver@pivotal.io
http://JavaFXpert.com
http://CulturedEar.com
@JavaFXpert
Java Champion, JavaOne Rockstar, plays well with others, etc :-)
Author of several Java/JavaFX/RaspPi books
@JavaFXpert
Mission: "Transform how the world builds software"
Mission: "Transform how the world builds software"
ConceptMap.io source code for services and UI: https://github.com/JavaFXpert/wikibrowser-service
Open source, licensed under the Apache License, Version 2.0
Note: These Technical Presentation slides are available at
http://slides.com/javafxpert/conceptmap-technical
as well as by clicking the Help button in ConceptMap.io
@JavaFXpert
Graphic from presentation by Lynda Pintscher
@JavaFXpert
Graphic from 2013 presentation by Lynda Pintscher
@JavaFXpert
Graphic from 2013 presentation by Lynda Pintscher
Media files leveraged by Wikimedia projects
@JavaFXpert
Graphic from 2013 presentation by Lynda Pintscher
Central storage for the structured data of Wikimedia projects
@JavaFXpert
Graphic from 2013 presentation by Lynda Pintscher
Provides semantic structure for Wikipedia articles in any language
@JavaFXpert
Wikipedia articles and their relationships to each other
@JavaFXpert
Navigate/pin Wikipedia articles via links and Wikidata relationships
@JavaFXpert
Search for an item and pin it to the concept map
Select a link in the Wikipedia article
Pin the item to the concept map
Select an item in the map, expand a relationship, and select an item
Pin the item to the concept map
Select an item in the map, and click the [x1] button for a relationship
The [x1] button pinned the items found at the first level of the relationship
Select an item in the concept map, and select an item From Related Items
Pin the item to the concept map
Continue selecting items from Wikipedia articles and Wikidata Relationships
... and pin them to the concept map
Edit relationships for an item by selecting Wikidata icon
Wikidata page appears with which anyone may edit the item's info
Select the Link icon to create a link to the concept map
Share the link to your concept map with a colleague or student
High-level view of distributed architecture
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, b
OPTIONAL MATCH (a)-[rel]-(b)
RETURN a, b, collect(rel)
(find all relationships between pinned items)
http://example/visgraph?items=Q2,Q405,Q525
Note: Because Jackson 2 is on the classpath, Spring’s MappingJackson2HttpMessageConverter is automatically chosen to convert the GraphResponseNear instance to JSON
@RestController
public 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 Building a RESTful Web Service Spring Guide
public 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;
}
}
(expand items related by a given property to a given depth)
Text
(all shortest paths, two hops or less)
http://example/visshortpaths?id=Q111&target=Q313
MATCH p=allShortestPaths(
(a:Item {itemId:'Q111'})-[*..2]-(b:Item {itemId:'Q313'})
)
RETURN p
(all shortest paths, two hops or less)
(shortest path to Entity using subclass of, instance of, part of)
http://example/visrootpaths?id=Q332
MATCH p=allShortestPaths(
(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)
package com.javafxpert.wikibrowser;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@EnableConfigurationProperties
@SpringBootApplication
public class WikiBrowserServiceApplication {
public static void main(String[] args) {
SpringApplication.run(WikiBrowserServiceApplication.class, args);
}
}
To learn more, see Building a RESTful Web Service Spring Guide
Note: One method of deployment for Spring Boot apps is a JAR file, which contains an embedded Tomcat servlet container.
Text
(shortest path, like Kevin Bacon game)
"ask concept map"
"get teams for Lionel Messi"
AWS Lambda developed in Java
James L. Weaver
Developer Advocate
Twitter: @JavaFXpert
Email: jweaver@pivotal.io
http://JavaFXpert.com
http://CulturedEar.com
Hope you enjoyed