docDatabase

package
v0.0.0-...-d578a7f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 3, 2019 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddDocument

func AddDocument(conn bolt.Conn, document structures.Document, urlStartDoc string)

Aggiungo il documento, gli autori che lo hanno scritto (con le relative relazioni) urlStartDoc e' l'URL del documento che viene citato da doc: se e' "" allora doc e' il documento da cui e' partita l'esplorazione

func AddDocumentBasic_MA

func AddDocumentBasic_MA(conn bolt.Conn, document structures.MADocument, URLStartDoc string, graphNumber int)

Crea un nodo che ha solo: titolo, numCitazioni e linkCitazioni. Niente autori, ne sources

func AddDocument_MA

func AddDocument_MA(conn bolt.Conn, document structures.MADocument, URLStartDoc string)

Aggiungo il documento, gli autori che lo hanno scritto (con le relative relazioni) e tutte le informazioni dei doc MA (eccetto la data che non riesco a prendere) urlStartDoc e' l'URL del documento che viene citato da doc: se e' "" allora doc e' il documento da cui e' partita l'esplorazione NOTA: Per ora Source lo spezzo in 2 proprieta': sourceWWW, sourcePDF; poi dovro' creare un nodo a parte con una relazione che lo lega al documento. TUTTA DA RIVEDERE------------------------------------------------------------

func AlreadyExplored

func AlreadyExplored(conn bolt.Conn, URL string, graphNumber int) bool

Controllo se il documento e' gia stato esplorato: ha gia' dei doc che lo citano. NOTA: Non e' proprio vero perche' un doc potrebbe non avere figli che soddisfano la soglia minima, ma a me va benem cosi'

func CleanAll

func CleanAll(conn bolt.Conn)

Pulisce il database da tutti i nodi e le relazioni

func CleanAllDocument

func CleanAllDocument(conn bolt.Conn)

Pulisce il database da tutti i nodi con label "Document" (cioe' che provengono da scholar) e le relative relazioni

func CreateDocumentsRelations

func CreateDocumentsRelations(conn bolt.Conn)

Creates a relation "CITE_FIELD" from two documents that have the same field and are linked by the relation "CITE", this relation has the field's name as property.

func CreateFieldsRelations

func CreateFieldsRelations(conn bolt.Conn)

Creates a relation "CITE2" between two "MAFieldOfStudy2" whose names appear consecutively in two "CITE_FIELD"

func CreateNewFields

func CreateNewFields(conn bolt.Conn)

Creates a new node (label:"MAFieldOfStudy2") for each field "MAFieldOfStudy"

func DeleteGraph

func DeleteGraph(conn bolt.Conn, graphNumber int) bool

DeleteGraph remove from the database all documents and relations relative to a specific research

func DoesDocumentHaveField

func DoesDocumentHaveField(conn bolt.Conn, title, fieldName string, graphNumber int) bool

DoesDocumentHaveField returns true if the document (title) has the field of study specified, false otherwise. NOTA: dovrei usare l'URL del documento non il suo titolo

func FieldsRanking

func FieldsRanking(conn bolt.Conn, numFields, graphNumber int, print bool) map[string]int

FieldsRanking queries the db to retrieve the top <numFields> field. If <numFields> == -1 -> there's no limit The field score is the number of edges from one article to another whose property "name" is equal to the field. If print -> print to stdOut the ranking

func GetGraphDocuments

func GetGraphDocuments(conn bolt.Conn, graphNumber int) []structures.CiteRelation

GetGraphDocuments get the info aboute "CITE" relation:

(title1)-[CITE]->(title2)

for all the documents of a graph (or all db if graphNumber == -1)

func GetGraphFields

func GetGraphFields(conn bolt.Conn) []structures.CiteRelation

GetGraphFields get the info aboute "CITE2" relation:

(field1)-[CITE2]->(field2)

for all the fields of all db (for now) ///////of a graph (or all db if graphNumber == -1)

func GetResearchNumber

func GetResearchNumber(conn bolt.Conn) int

GetResearchNumber returns the number of graphs (of searches) in the db

func PrepareDBForDotFileFields

func PrepareDBForDotFileFields()

ONLY FOR GRAPH NUMBER 5 1) Create relations between articles that have the same field 2) Create a new node for each field 3) Create relations between these nodes

func StartNeo4j

func StartNeo4j() bolt.Conn

Crea una nuova connessione con Neo4j

func StartPoolNeo4j

func StartPoolNeo4j(connectionNumber int) []bolt.Conn

Crea un pool di connessioni con Neo4j come e' diviso pool: array di connesioni : pos=0 (connessione di Concurrency) pos = [1,numThread] (connessioni per i Thread)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL