Skip to content
Baoxu "Dash" Shi edited this page Dec 14, 2015 · 2 revisions

Download and Build

Required package

Usage

RDF Parser

Graph Server

Input format:

  • edgeList
format: sourceId,destinationId,edgeTypeId
1,2,1
1,2553,671
1,3,2
1,3850286,671
1,5,3
  • nodeList
format: nodeId \t node_title
4743012 Sarotti
4743011 Royal_Aberdeen_Golf_Club
4743010 BASIC-11
4743009 Multi-user_BASIC
4743007 NetBeans_BlueJ_Edition
4743006 1552_Bessel
4743000 Dance_till_Tomorrow__ova__1
4742998 1984–85_Yugoslav_Second_League
4742997 Neale_Porter
4742996 Richard_Challenger
4742994 Benjamin_Roberts_(governor)
4742991 2010_Iran_Futsal's_2nd_Division
  • edgeTypeList
format: edgetypeId \t title
670     show
669     organSystem
667     capitalCountry
665     previousMission
663     booster
662     boilerPressure
666     nextMission
659     winterAppearances
657     rightChild
656     aircraftHelicopterObservation

Client

Please use socat as the client or you can implement your own client since the gbserver is based on standard Unix socket.

A standard request looks like this:

echo "COMMAND" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver

COMMAND contains the real command that sends to the server, and -t 3600 means socat will timeout if there is no data transferred after 3600 seconds. Note that after the client received the response, the server will close the socket gracefully. We enlarge this timeout to make sure the client can always get responses even if the computation time of the request command is very long.

Request Commands

Check if two entities are connected by certain predicate

connectedby SRC DST REL_TYPE

Get all entity pairs that matches the ontology of given entity pairs and predicate

truelabeled SRC DST REL_TYPE

Get all entity pairs that matches the ontology of given entity paris but not the predicate

falselabeled SRC DST REL_TYPE

Find in-coming neighbors

in_neighbor id

Find out-going neighbors

out_neighbor id

Return ontology of given node

ontology id SEMANTIC?[T|F]

Find nodes that matches at least one ontology class of given node

siblings id

Find nodes that exactly matches the ontology of given node

esiblings id

Return the number of entities that sharing at least on ontology class with given node

nsiblings id

Find untyped path between given node pairs

path SRC DST MAX_DIST DIRECTED?[T|F] SEMANTIC?[T|F]

examples:

Find untyped, directed paths between 221 and 10387 with a length less or equal to 3. Display them in human-readable format.

bshi@dsg1:~$ time echo "path 221 10387 3 T T" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
find 1 paths
Alabama--Montgomery,_Alabama--

real	0m0.006s
user	0m0.001s
sys	0m0.005s

Find untyped, directed paths between 221 and 10387 with a length less or equal to 3. Display them in numeric id format.

bshi@dsg1:~$ time echo "path 221 10387 3 T F" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
find 1 paths
221--10387--

real	0m0.006s
user	0m0.004s
sys	0m0.001s

Find untyped, undirected paths between 221 and 10387 with a length less or equal to 3. Display them in human-readable format.

bshi@dsg1:~$ time echo "path 221 10387 3 F T" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
find 55 paths
Alabama--United_States--Montgomery,_Alabama--
Alabama--Montgomery,_Alabama--
Alabama--Alabama_State_University--Montgomery,_Alabama--
Alabama--Alabama_Historical_Commission--Montgomery,_Alabama--
Alabama--John_Cooper_Godbold--Montgomery,_Alabama--
...
Alabama--Alabama_Department_of_Mental_Health--Montgomery,_Alabama--

real	0m0.331s
user	0m0.000s
sys	0m0.012s

Find typed path between given node pairs

hpath SRC DST MAX_DIST DIRECTED?[T|F] SEMANTIC?[T|F]

examples:

Find typed, directed paths between 221 and 10387 with a length less or equal to 3. Display them in human-readable format.

bshi@dsg1:~$ time echo "hpath 221 10387 3 T T" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
find 1 paths
Alabama-(capital)-Montgomery,_Alabama-

real	0m0.005s
user	0m0.000s
sys	0m0.005s

Find typed, directed paths between 221 and 10387 with a length less or equal to 3. Display them in numeric id format.

bshi@dsg1:~$ time echo "hpath 221 10387 3 T F" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
find 1 paths
221-(191)-10387-

real	0m0.005s
user	0m0.000s
sys	0m0.006s

Find typed, undirected paths between 221 and 10387 with a length less or equal to 3. Display them in human-readable format. Note that (-1) means the actual relation in the graph is A<-B instead of the displayed direction A-B.

bshi@dsg1:~$ time echo "hpath 221 10387 3 F T" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
find 139 paths
Alabama-(country)-United_States-(-1)(country)-Montgomery,_Alabama-
Alabama-(capital)-Montgomery,_Alabama-
Alabama-(http://www.w3.org/1999/02/22-rdf-syntax-ns#type)-Place-(-1)(http://www.w3.org/1999/02/22-rdf-syntax-ns#type)-Montgomery,_Alabama-
...
Alabama-(-1)(deathPlace)-William_Louis_Dickinson-(deathPlace)-Montgomery,_Alabama-
Alabama-(-1)(birthPlace)-Doe_B-(birthPlace)-Montgomery,_Alabama-
Alabama-(-1)(birthPlace)-Doe_B-(deathPlace)-Montgomery,_Alabama-
Alabama-(-1)(deathPlace)-Doe_B-(birthPlace)-Montgomery,_Alabama-
Alabama-(-1)(deathPlace)-Doe_B-(deathPlace)-Montgomery,_Alabama-
Alabama-(-1)(regionServed)-Alabama_Department_of_Mental_Health-(headquarter)-Montgomery,_Alabama-

real	0m1.196s
user	0m0.001s
sys	0m0.005s

Adamic Adar

L. A. Adamic and E. Adar, “Friends and neighbors on the Web,” Social Networks, vol. 25, no. 3, pp. 211–230, Jul. 2003.

aa ID1 ID2

examples:

bshi@dsg1:~$ time echo "aa 221 10387" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
45.079737
real	0m0.008s
user	0m0.000s
sys	0m0.007s

Semantic Proximity

G. L. Ciampaglia, P. Shiralkar, L. M. Rocha, J. Bollen, F. Menczer, and A. Flammini, “Computational fact checking from knowledge networks,” Physical review E, vol. cs.CY. 14-Jan-2015.

sp ID1 ID2

examples:

bshi@dsg1:~$ time echo "sp 221 10387" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
0.419060
real	0m1.659s
user	0m0.002s
sys	0m0.005s

Multidimensional Adamic Adar

G. Rossetti, M. Berlingerio, and F. Giannotti, “Scalable Link Prediction on Multidimensional Networks.,” ICDM Workshops, pp. 979–986, 2011.

maa ID1 ID2 REL_TYPE

examples:

When REL_TYPE==0(indicating all edge relations), MAA equals to normal Adamic Adar index.

bshi@dsg1:~$ time echo "maa 221 10387 0" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
45.079737
real	0m0.009s
user	0m0.000s
sys	0m0.004s
bshi@dsg1:~$ time echo "maa 221 10387 123" | socat -t 3600 - UNIX-CONNECT:/tmp/gbserver
0.000000
real	0m0.007s
user	0m0.000s
sys	0m0.005s

Personalized PageRank

T. H. Haveliwala, “Topic-sensitive pagerank,” presented at the WWW, 2002, pp. 517–526.

ppr SRC DST

Preferential Attachment

A. L. Barabasi, H. Jeong, Z. Neda, E. Ravasz, A. Schubert, and T. Vicsek, “Evolution of the social network of scientific collaborations,” Physical review E, vol. cond-mat.soft. 09-Apr-2001.

pa ID1 ID2

Katz

L. Katz, “A new status index derived from sociometric analysis,” Psychometrika, vol. 18, no. 1, pp. 39–43, 1953.

katz ID1 ID2