-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBMstoreReset.pl
85 lines (73 loc) · 3.74 KB
/
BMstoreReset.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
:- ['BMsemWebTools.pl'].
todayReset :-
date(date(Y, M, D)),
atomic_list_concat([Y, M, D], '-', Date),
clearGraphsByDate(Date),
findall(_, resetGraph(_), _).
clearGraphsByDate(Date) :-
findall(_, clearGraphByDate(Date), _).
clearGraphByDate(Date) :-
QueryTriples = [
['?graph', dc:'date', literal(Date)],
['?graph', rdf:'type', void:'Dataset']
], !,
sparqlSelectQueryGlobal(QueryTriples, '?graph', [Graph]),
sparqlClearGraph(Graph).
clearGraphByTitle(Title) :-
QueryTriples = [
['?graph', dc:'title', literal(Title)],
['?graph', rdf:'type', void:'Dataset']
], !,
sparqlSelectQueryGlobal(QueryTriples, '?graph', [Graph]),
sparqlClearGraph(Graph).
resetGraph(submitter) :-
Graph = 'http://purl.bioontology.org/net/brunel/bm/submitter_graph',
Triples = [
[Graph, dc:'title', literal('Submitter data')],
[Graph, dc:'description', literal('This dataset contains information about the agents submitting index cards to the system.')],
['http://purl.bioontology.org/net/brunel/bm/brunel', rdf:'type', panda:'Submitter'],
['http://purl.bioontology.org/net/brunel/bm/brunel', rdfs:'label', literal('Brunel')]
],
resetGraph(Graph, Triples).
resetGraph(event) :-
Graph = 'http://purl.bioontology.org/net/brunel/bm/event_graph',
Triples = [
[Graph, dc:'title', literal('Biological event data')],
[Graph, dc:'description', literal('This dataset contains generic descriptions of biological events (molecular interactions), which are referenced by the statements extracted from the literature.')]
],
resetGraph(Graph, Triples).
resetGraph(strings) :-
Graph = 'http://purl.bioontology.org/net/brunel/bm/strings_db_graph',
Triples = [
[Graph, dc:'title', literal('STRING DB statements')],
[Graph, dc:'description', literal('This dataset contains statements extracted from the database STRING DB (see: http://string-db.org/). The statements include protein-protein interactions in the human organism.')],
['http://purl.bioontology.org/net/brunel/bm/strings_db_provenance_prob', rdf:'type', uno:'UncertaintyRelevantToDocumentProvenance'],
['http://purl.bioontology.org/net/brunel/bm/strings_db_provenance_prob', uno:'hasUncertaintyLevel', literal(0.9)],
['http://purl.bioontology.org/net/brunel/bm/strings_db_provenance_prob', rdfs:'label', literal(0.9)]
],
resetGraph(Graph, Triples).
resetGraph(source) :-
Graph = 'http://purl.bioontology.org/net/brunel/bm/source_graph',
Triples = [
[Graph, dc:'title', literal('Source information data')],
[Graph, dc:'description', literal('This dataset contains information about journal articles, bioinformatics databases, and other sources from which statements might have been extracted.')],
['http://string-db.org/', rdf:'type', panda:'Database'],
['http://string-db.org/', rdfs:'label', literal('STRING DB')]
],
resetGraph(Graph, Triples).
resetGraph(Graph, Triples) :-
%sparqlClearGraph(Graph),
date(date(Y, M, D)),
atomic_list_concat([Y, M, D], '-', Date),
atomic_list_concat([Graph, '.rdf'], GraphDump),
atomic_list_concat([Graph, '.graph'], GraphBrowse),
GenericTriples = [
[Graph, rdf:'type', void:'Dataset'],
[Graph, rdf:'type', prov:'Entity'],
[Graph, dc:'creator', literal('Big Mechanism')],
[Graph, dc:'date', literal(Date)],
[Graph, void:'dataDump', GraphDump],
[Graph, void:'dataBrowse', GraphBrowse]
],
union(GenericTriples, Triples, TargetTriples),
sparqlInsertQuery(TargetTriples, Graph).