SlideShare ist ein Scribd-Unternehmen logo
1 von 20
R, IGRAPH, AND
HANDSOME GRAPHS

       &
OVERVIEW
HISTORY OF PHILOSOPHY
•


•




•
GET THE DATA: THE QUERY
•                # Create the query
                 qq <- 'SELECT * WHERE {
    –
                 ?p a
                 <http://dbpedia.org/onto
                 logy/Philosopher> . ?p
                 <http://dbpedia.org/onto
                 logy/influenced>
    –            ?influenced. }'
    –
                 # Use it in SPARQL
•                data <-
                 SPARQL(url='http://dbped
                 ia.org/sparql',query=qq)
GET THE DATA: CLEANING
•                # Prep to make it directed
                 orig <- unlist(data$results[[2]],
                 use.names=F)
                 dest <- unlist(data$results[[1]],
         &       use.names=F)

                 # Turn URLs into readable names
•                orig <- url2names(orig)
    –            dest <- url2names(dest)

    –            # Format as an edge graph.
                 edges <-
                 data.frame(cbind(as.matrix(orig),as.
                 matrix(dest), rep(1,length(orig))),
                 stringsAsFactors=F)

                 # TADA!
R TOOLS
•
    –


    –

    –
USING IGRAPH
•                             g <- graph.data.frame(edges, direct=TRUE,
                              vertices=NULL)
    –
    –                         SNAbasics <- function(X) {
    –                         V(X)$label <- V(X)$name
                              comps <- leading.eigenvector.community(X,
    –                         options=list(naive=F))$membership
•                             colbar <- rainbow(max(comps)+1)
                              V(X)$color <- colbar[comps+1]
    –                         # REMOVE OPACITY
        • V(g) <- values      V(X)$color <- substr(V(X)$color,1,7)
        • set.vertex.attrib   RPageRank <- page.rank(X, vids=V(X),
          ute(g,values)       directed=TRUE,
    –                         options=list(maxiter=10000,eps=0.0001))$ve
                              ctor
                              V(X)$RPageRank <- RPageRank*1000
                              V(X)$size <- RPageRank*1000
    –                         V(X)$Katz <- evcent(X)$vector*1000
                              print(length(unique(comps)))
                              return(X)
                              }
VISUALIZATION LAYOUTS
R VISUALIZATION OPTIONS
R2OTHER
•
    –
•
    –
•
    –
•
    –
    –       python -m SimpleHTTPServer 8000
        •
        •
GRAPH DATABASES
•
    –

    –
•
    –

    –


    –
TO GEPHI
•
•
    –



        • write.graph(g,
          file='gephi.GML',
          format='GML')

    –
TO GRAPHVIZ (WITH DOT)
•
•


•


•
JSON -> D3
•
•
    –
    –
    –

•
    – As.numeric
    – stringsAsFactors
      =FALSE
    –
GEPHI -> SIGMA.JS
•
•




•
HAIRBALLS AND HIVES
•




•
INTERACTIVE HAIRBALLS?
•



•


    –


•
•
CHALLENGES!
•                                  graph2web()
    –
    –
        • PlotInMyBrowser(mydata,myport)
    –
•
    –
•
THANKS
•
•
•
•

Weitere ähnliche Inhalte

Was ist angesagt?

JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
PROIDEA
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)
riue
 
Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReactNik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReact
OdessaJS Conf
 

Was ist angesagt? (20)

Codigos
CodigosCodigos
Codigos
 
Invertible-syntax 入門
Invertible-syntax 入門Invertible-syntax 入門
Invertible-syntax 入門
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
A deeper-understanding-of-spark-internals
A deeper-understanding-of-spark-internalsA deeper-understanding-of-spark-internals
A deeper-understanding-of-spark-internals
 
Metaprogramming in Haskell
Metaprogramming in HaskellMetaprogramming in Haskell
Metaprogramming in Haskell
 
Data profiling with Apache Calcite
Data profiling with Apache CalciteData profiling with Apache Calcite
Data profiling with Apache Calcite
 
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
CREATE INDEX … USING VODKA. VODKA CONNECTING INDEXES, Олег Бартунов, Александ...
 
Drools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL SyntaxDrools5 Community Training Module 3 Drools Expert DRL Syntax
Drools5 Community Training Module 3 Drools Expert DRL Syntax
 
Switching from java to groovy
Switching from java to groovySwitching from java to groovy
Switching from java to groovy
 
The PostgreSQL JSON Feature Tour
The PostgreSQL JSON Feature TourThe PostgreSQL JSON Feature Tour
The PostgreSQL JSON Feature Tour
 
Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access Slick: Bringing Scala’s Powerful Features to Your Database Access
Slick: Bringing Scala’s Powerful Features to Your Database Access
 
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
JDD2015: Functional programing and Event Sourcing - a pair made in heaven - e...
 
関数潮流(Function Tendency)
関数潮流(Function Tendency)関数潮流(Function Tendency)
関数潮流(Function Tendency)
 
Nik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReactNik Graf - Get started with Reason and ReasonReact
Nik Graf - Get started with Reason and ReasonReact
 
Django101 geodjango
Django101 geodjangoDjango101 geodjango
Django101 geodjango
 
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin WayTDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
TDC218SP | Trilha Kotlin - DSLs in a Kotlin Way
 
Saving Gaia with GeoDjango
Saving Gaia with GeoDjangoSaving Gaia with GeoDjango
Saving Gaia with GeoDjango
 
Introducción rápida a SQL
Introducción rápida a SQLIntroducción rápida a SQL
Introducción rápida a SQL
 
Deep dive to PostgreSQL Indexes
Deep dive to PostgreSQL IndexesDeep dive to PostgreSQL Indexes
Deep dive to PostgreSQL Indexes
 
Why The Free Monad isn't Free
Why The Free Monad isn't FreeWhy The Free Monad isn't Free
Why The Free Monad isn't Free
 

Andere mochten auch

Visualizando red FB Digicom SIyP con Gephi
Visualizando red FB Digicom SIyP con GephiVisualizando red FB Digicom SIyP con Gephi
Visualizando red FB Digicom SIyP con Gephi
Jorge Yunes
 

Andere mochten auch (17)

Redes Sociales en la Educación
Redes Sociales en la EducaciónRedes Sociales en la Educación
Redes Sociales en la Educación
 
Integrar redes sociales en el aula
Integrar redes sociales en el aulaIntegrar redes sociales en el aula
Integrar redes sociales en el aula
 
Taller de Instagram para profesionales
 Taller de  Instagram para profesionales Taller de  Instagram para profesionales
Taller de Instagram para profesionales
 
Antonio A. Casilli - Networks, complexity, and privacy
Antonio A. Casilli - Networks, complexity, and privacyAntonio A. Casilli - Networks, complexity, and privacy
Antonio A. Casilli - Networks, complexity, and privacy
 
Visualizando red FB Digicom SIyP con Gephi
Visualizando red FB Digicom SIyP con GephiVisualizando red FB Digicom SIyP con Gephi
Visualizando red FB Digicom SIyP con Gephi
 
Adaptive Collective Systems - Herding black sheep
Adaptive Collective Systems - Herding black sheepAdaptive Collective Systems - Herding black sheep
Adaptive Collective Systems - Herding black sheep
 
Disc2013 keynote speakers
Disc2013 keynote speakersDisc2013 keynote speakers
Disc2013 keynote speakers
 
Community detection in graphs with NetworKit
Community detection in graphs with NetworKitCommunity detection in graphs with NetworKit
Community detection in graphs with NetworKit
 
Multilayer tutorial-netsci2014-slightlyupdated
Multilayer tutorial-netsci2014-slightlyupdatedMultilayer tutorial-netsci2014-slightlyupdated
Multilayer tutorial-netsci2014-slightlyupdated
 
Online conversation as networks
Online conversation as networksOnline conversation as networks
Online conversation as networks
 
Gephi Plugin Developer Workshop
Gephi Plugin Developer WorkshopGephi Plugin Developer Workshop
Gephi Plugin Developer Workshop
 
UNSTUCK: An introduction to Ribbonfarm Consulting
UNSTUCK: An introduction to Ribbonfarm ConsultingUNSTUCK: An introduction to Ribbonfarm Consulting
UNSTUCK: An introduction to Ribbonfarm Consulting
 
Social networks for managers
Social networks for managersSocial networks for managers
Social networks for managers
 
RSlovakia #1 meetup
RSlovakia #1 meetupRSlovakia #1 meetup
RSlovakia #1 meetup
 
Questions Numériques 2014/2015 : Les Controverses
Questions Numériques 2014/2015 : Les ControversesQuestions Numériques 2014/2015 : Les Controverses
Questions Numériques 2014/2015 : Les Controverses
 
Gamification - Defining, Designing and Using it
Gamification - Defining, Designing and Using itGamification - Defining, Designing and Using it
Gamification - Defining, Designing and Using it
 
Social Network Analysis & an Introduction to Tools
Social Network Analysis & an Introduction to ToolsSocial Network Analysis & an Introduction to Tools
Social Network Analysis & an Introduction to Tools
 

Ähnlich wie Rug hogan-10-03-2012

Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)
Chia-Chi Chang
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
Dmitry Buzdin
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
agnonchik
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
Kaz Watanabe
 
楽々Scalaプログラミング
楽々Scalaプログラミング楽々Scalaプログラミング
楽々Scalaプログラミング
Tomoharu ASAMI
 
R (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support SystemR (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support System
Maithreya Chakravarthula
 

Ähnlich wie Rug hogan-10-03-2012 (20)

Hadoop london
Hadoop londonHadoop london
Hadoop london
 
Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)Learning notes of r for python programmer (Temp1)
Learning notes of r for python programmer (Temp1)
 
Refactoring to Macros with Clojure
Refactoring to Macros with ClojureRefactoring to Macros with Clojure
Refactoring to Macros with Clojure
 
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj TalkSpark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
Spark + Clojure for Topic Discovery - Zalando Tech Clojure/Conj Talk
 
Rails 3.1 Asset Pipeline
Rails 3.1 Asset PipelineRails 3.1 Asset Pipeline
Rails 3.1 Asset Pipeline
 
Introduction to R for data science
Introduction to R for data scienceIntroduction to R for data science
Introduction to R for data science
 
R Workshop for Beginners
R Workshop for BeginnersR Workshop for Beginners
R Workshop for Beginners
 
Schema Design by Chad Tindel, Solution Architect, 10gen
Schema Design  by Chad Tindel, Solution Architect, 10genSchema Design  by Chad Tindel, Solution Architect, 10gen
Schema Design by Chad Tindel, Solution Architect, 10gen
 
Emerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the HorizonEmerging Languages: A Tour of the Horizon
Emerging Languages: A Tour of the Horizon
 
A Shiny Example-- R
A Shiny Example-- RA Shiny Example-- R
A Shiny Example-- R
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource第49回Php勉強会@関東 Datasource
第49回Php勉強会@関東 Datasource
 
An overview of Python 2.7
An overview of Python 2.7An overview of Python 2.7
An overview of Python 2.7
 
A tour of Python
A tour of PythonA tour of Python
A tour of Python
 
楽々Scalaプログラミング
楽々Scalaプログラミング楽々Scalaプログラミング
楽々Scalaプログラミング
 
R (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support SystemR (Shiny Package) - Server Side Code for Decision Support System
R (Shiny Package) - Server Side Code for Decision Support System
 
ITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function ProgrammingITT 2015 - Saul Mora - Object Oriented Function Programming
ITT 2015 - Saul Mora - Object Oriented Function Programming
 
Geospatial Data in R
Geospatial Data in RGeospatial Data in R
Geospatial Data in R
 
SVGo workshop
SVGo workshopSVGo workshop
SVGo workshop
 

Kürzlich hochgeladen

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Kürzlich hochgeladen (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 

Rug hogan-10-03-2012

  • 4. GET THE DATA: THE QUERY • # Create the query qq <- 'SELECT * WHERE { – ?p a <http://dbpedia.org/onto logy/Philosopher> . ?p <http://dbpedia.org/onto logy/influenced> – ?influenced. }' – # Use it in SPARQL • data <- SPARQL(url='http://dbped ia.org/sparql',query=qq)
  • 5. GET THE DATA: CLEANING • # Prep to make it directed orig <- unlist(data$results[[2]], use.names=F) dest <- unlist(data$results[[1]], & use.names=F) # Turn URLs into readable names • orig <- url2names(orig) – dest <- url2names(dest) – # Format as an edge graph. edges <- data.frame(cbind(as.matrix(orig),as. matrix(dest), rep(1,length(orig))), stringsAsFactors=F) # TADA!
  • 6. R TOOLS • – – –
  • 7. USING IGRAPH • g <- graph.data.frame(edges, direct=TRUE, vertices=NULL) – – SNAbasics <- function(X) { – V(X)$label <- V(X)$name comps <- leading.eigenvector.community(X, – options=list(naive=F))$membership • colbar <- rainbow(max(comps)+1) V(X)$color <- colbar[comps+1] – # REMOVE OPACITY • V(g) <- values V(X)$color <- substr(V(X)$color,1,7) • set.vertex.attrib RPageRank <- page.rank(X, vids=V(X), ute(g,values) directed=TRUE, – options=list(maxiter=10000,eps=0.0001))$ve ctor V(X)$RPageRank <- RPageRank*1000 V(X)$size <- RPageRank*1000 – V(X)$Katz <- evcent(X)$vector*1000 print(length(unique(comps))) return(X) }
  • 10. R2OTHER • – • – • – • – – python -m SimpleHTTPServer 8000 • •
  • 11. GRAPH DATABASES • – – • – – –
  • 12. TO GEPHI • • – • write.graph(g, file='gephi.GML', format='GML') –
  • 13. TO GRAPHVIZ (WITH DOT) • • • •
  • 14. JSON -> D3 • • – – – • – As.numeric – stringsAsFactors =FALSE –
  • 18. CHALLENGES! • graph2web() – – • PlotInMyBrowser(mydata,myport) – • – •
  • 19.