Network Graph Databases, RDF, SPARQL, and SNA
Transcript of Network Graph Databases, RDF, SPARQL, and SNA
![Page 1: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/1.jpg)
Network Graph Databases, RDF, SPARQL, and SNA
NoCOUG Summer Conference August 16 2012 at Chevron in San Ramon, CA
David Abercrombie
Data Analytics Engineer, Tapjoy [email protected]
![Page 2: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/2.jpg)
About me
Former (Oracle) Performance Diagnostics Capacity planning
Current (Vertica, column store, parallel, BI) Data structure design & SQL DBA
Graph databases are a hobby
![Page 3: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/3.jpg)
Semantic Web for the Working Ontologist Morgan Kaufmann
2nd ed. June 2011
Dr. Dean Allemang
TopQuadrant, Inc.
S is for Semantics
Dr. Jim Hendler
Rensselaer Polytechnic Institute
![Page 4: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/4.jpg)
Big Data SF Bay Area (a LinkedIn Group)
6:30 to 9:00pm TONIGHT!
Santa Clara
Dave Rubin, Oracle Oracle’s NoSQL
Brian Clark, Objectivity InfiniteGraph
![Page 5: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/5.jpg)
NoSQL Now! August 21-23, San Jose
Keynote: Creating Powerful New Applications with Graphs
Tutorial: Introduction to Graph Databases
Intro to Graph Databases 101
Transform Big Data into Actionable Intelligence with Graphs
Use Graph Databases to Analyze Relationships, Risks, and Business
Opportunities – A Case Study
Lunch ‘N Learn with Neo4j
![Page 6: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/6.jpg)
Oracle Database 11g Spatial and Graph RDF Semantic Graph
RDF management platform
Graph data model
RDF data (triples) are persisted, indexed and queried
June 2010 Oracle workshop presentation PDFs
An Enterprise Inference Engine Inside Oracle…
… How to Install, Load, Query and Inference
![Page 7: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/7.jpg)
RDF Resource Description Framework
![Page 8: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/8.jpg)
Resource Description Framework
A "language for representing information about resources in the World Wide Web"
Generalized:
From directly retrieved on the Web
To identified on the Web
Applications, not humans
Exchange
![Page 9: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/9.jpg)
Subject – Object - Predicate
Simple properties and property values
Must be well defined
Uniform Resource Identifier (URI)
![Page 10: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/10.jpg)
http://www.example.org/index.html has a creator
whose value is John Smith
Subject http://www.example.org/index.html
Predicate http://purl.org/dc/elements/1.1/creator
Object http://www.example.org/staffid/85740
This and the next several slides based on http://www.w3.org/TR/rdf-primer/
![Page 11: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/11.jpg)
As a directed graph
![Page 12: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/12.jpg)
More Details
![Page 13: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/13.jpg)
Triples Subject Predicate Object
staff:85740 terms:address addressid:85740
addressid:85740 terms:street "1501 Grant Avenue"
addressid:85740 terms:city "Bedford"
addressid:85740 terms:state "Massachusetts"
addressid:85740 terms:postalCode "01730"
![Page 14: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/14.jpg)
Serialization
Representing as a file
RDF/XML
Notation3 (N3)
Turtle
N-Triples
![Page 15: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/15.jpg)
Turtle Serialization
@prefix staff: <http://www.example.org/staffid> .
@prefix terms: <http://www.example.org/terms> .
@prefix addressid: <http://www.example.org/addressid> .
staff:85740 terms:address addressid:85740 .
staff:85740 terms:address addressid:85740 .
addressid:85740 terms:street "1501 Grant Avenue" .
addressid:85740 terms:city "Bedford" .
addressid:85740 terms:state "Massachusetts" .
addressid:85740 terms:postalCode "01730" .
![Page 16: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/16.jpg)
SPARQL SPARQL Protocol And RDF Query Language
![Page 17: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/17.jpg)
SELECT ?who
WHERE {:JamesDean :playedIn ?what .
?what :directedBy ?who .}
Example SPARQL query from Working Ontologist 2012, pp. 68-9
JamesDean
RebelWithout
aCause NicolasRey
Giant
GeorgeStevens
FredGuiol
EastOfEden directedBy EliaKarzan
![Page 18: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/18.jpg)
JamesDean
RebelWithout
aCause NicolasRey
Giant
GeorgeStevens
FredGuiol
EastOfEden directedBy EliaKarzan
JamesDean playedIn ?what directedBy ?who
SPARQL query as a directed graph
![Page 19: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/19.jpg)
JamesDean playedIn ?what directedBy ?who
SPARQL query as a directed graph
SELECT ?who
WHERE {:JamesDean :playedIn ?what .
?what :directedBy ?who .}
![Page 20: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/20.jpg)
Properties and Schema
What kinds of things do we know about James Dean?
SELECT DISTINCT ?property
WHERE {:JamesDean ?property ?value}
What kinds of things do we know about actors?
SELECT DISTINCT ?property
WHERE {?q0 a :Actor .
?q0 ?property ?object .}
See Working Ontologist 2012, pp. 78-83
![Page 21: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/21.jpg)
Other SPARQL Features
FILTER OPTIONAL UNSAID ASK CONSTRUCT Rules: when you see this, conclude that (define properties) Aggregates Subqueries Transitive (like Oracle’s CONNECT) ORDER BY LIMIT UNION See Working Ontologist 2012, pp. 83-112
![Page 22: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/22.jpg)
RDFS RDF Schema, Ontologies, and Inferencing
![Page 23: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/23.jpg)
Inference
Given some useful information, we can derive other related information
Asserted triples
Inferred triples
Inference rules
Inference engine
![Page 24: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/24.jpg)
Men’s Trail Running shoes are a type of Fitness Footwear
Fitness Footwear is a type of Fitness product
![Page 25: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/25.jpg)
:FitnessProduct rdf:type rdfs:Class .
:FitnessFootwear rdfs:subClassOf :FitnessProduct .
:MenTrailRunningShoe rdfs:subClassOf :FitnessFootwear .
rdfs:subClassOf
![Page 26: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/26.jpg)
rdfs:subPropertyOf :freeLancesTo rdfs:subPropertyOf contractsTo .
:indirectlyContractsTo rdfs:subPropertyOf :contractsTo .
:isEmployedBy rdfs:subPropertyOf :worksFor .
:contractsTo rdfs:subPropertyOf :worksFor .
Example from Working Ontologist 2012, pp. 128-9
worksFor
isEmployedBy
contractsTo
freeLancesTo
indiectlyContractsTo
![Page 27: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/27.jpg)
rdfs:subPropertyOf Asserted :Dave :freeLancesTo :TheFirm .
Inferred :Dave :contractsTo :TheFirm .
Inferred again :Dave :worksFor :TheFirm .
Example from Working Ontologist 2012, pp. 128-9
worksFor
isEmployedBy
contractsTo
freeLancesTo
indiectlyContractsTo
![Page 28: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/28.jpg)
RDFS domains (properties and classes)
Domain of square root is positive real numbers
For properties "P" and classes "D", we have
CONSTRUCT {?x rdf:type ?D . }
WHERE {?P rdfs:domain ?D .
?x ?P ?y . }
![Page 29: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/29.jpg)
:MarriedWoman rdfs:subClassOf :Woman .
:hasMaidenName :rdfs:domain :MarriedWoman .
Example from Working Ontologist 2012, pp. 130-2
rdfs:domain
hasMaidenName rdfs:domain MarriedWoman rdfs:subClassOf Woman
![Page 30: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/30.jpg)
If we assert
:Karen :hasMaidenName "Abercrombie" .
We can infer
:Karen rdf:type :MarriedWoman .
:Karen rdf:type :Woman .
Example from Working Ontologist 2012, pp. 130-2
rdfs:domain
hasMaidenName rdfs:domain MarriedWoman rdfs:subClassOf Woman
![Page 31: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/31.jpg)
SNA Social Network Analysis
![Page 32: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/32.jpg)
Social Network Graph
Ding, Finin, and Joshi found these basic patterns in Friend-of-a-Friend networks
![Page 33: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/33.jpg)
Indirect connections
Kinsella, Harth, and Breslin studied networks of objects and people
![Page 34: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/34.jpg)
Ontologies
FOAF: Friend of a Friend Knows, based_near, interest
SIOC: Semantically-Interlinked Online Communities
Site, Post, Thread, Forum
SCOT: Social Semantic Cloud of Tags Tagging, Web 2.0
![Page 35: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/35.jpg)
Social Network Analysis (SNA)
Bridges
Centrality
Clustering
Cohesion
Density
Visualization
![Page 36: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/36.jpg)
AllegroGraph lisp API examples
Graphs Measures nodal-degree nodal-neighbors ego-group
Centrality Measures graph-density actor-degree-centrality group-degree-centrality actor-closeness-centrality group-betweenness-centrality
Cliques cliquep cliques map-cliques
![Page 37: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/37.jpg)
REFERENCES The End
![Page 38: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/38.jpg)
Graph Databases
Oracle Spatial and Graph RDF Semantic Graph (Formerly Oracle Database Semantic Technologies)
InfiniteGraph (Objectivity)
W3C LargeTripleStores AllegroGraph (1+Trillion) OpenLink Virtuoso v6.1 - 15.4B+ BigOWLIM (12B explicit, 20B total) Garlik 4store (15B) Bigdata(R) (12.7B) YARS2 (7B) Jena TDB (1.7B) Jena SDB (650M) …
![Page 39: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/39.jpg)
References
RDF Primer (HTML) Semantic Social Network Analysis (PDF) Network Analysis of Semantic Connections in
Heterogeneous Social Spaces (PDF) Analyzing Social Networks on the Semantic Web
(PDF) Network Analysis of Semantic Web Ontologies
(PDF) AllegroGraph 4.6 Overview (HTML) AllegroGraph on Amazon EC2 (HTML)
![Page 40: Network Graph Databases, RDF, SPARQL, and SNA](https://reader031.fdocuments.us/reader031/viewer/2022012011/613d4f44736caf36b75bcdd0/html5/thumbnails/40.jpg)
What did we talk about?
Upcoming meetings
RDF
SPARQL
RDFS
SNA