-
Notifications
You must be signed in to change notification settings - Fork 1
/
dev.php
89 lines (57 loc) · 2.08 KB
/
dev.php
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
85
86
87
88
<?php
$query = db_select('node', 'n', $options);
////
$query = db_select('users', 'u');
$query
->condition('u.uid', 0, '<>')
->fields('u', array('uid', 'name', 'status', 'created', 'access'))
->range(0, 50);
$result = $query->execute();
//////////
$myselect = db_select('mytable')
->fields('mytable')
->condition('myfield', 'myvalue');
$alias = $query->join($myselect, 'myalias', 'n.nid = myalias.nid');
$query->fields('n', array('nid', 'title', 'created', 'uid'));
// Force filtering of duplicate records in the result set.
$query->distinct()
$count_alias = $query->addExpression('COUNT(uid)', 'uid_count');
$query->orderBy('title', 'DESC');
$query->groupBy('uid');
$query->range(5, 10);
//// SPARQL lib API functions
// Insert data into a graph
// INSERT DATA { graph_triples }
// graph_triples :: = TriplesBlock | GRAPH <graph_uri> { TriplesBlock }
// INSERT DATA { GRAPH <http://example/bookStore> { <http://example/book3> dc:title "Fundamentals of Compiler Design" } }
rdfdb_insert_data($graph_triples)
// Delete data from a graph
// DELETE DATA { graph_triples }
// graph_triples :: = TriplesBlock | GRAPH <graph_uri> { TriplesBlock }
rdfdb_delete_data($graph_triples)
// @todo 4.1.3 DELETE/INSERT
// @todo 4.1.4 DELETE
// @todo 4.1.5 INSERT
// @todo 4.1.6 DELETE WHERE
// Load data from remote graph
// LOAD <documentURI> [ INTO GRAPH <uri> ]
rdfdb_load($document, $graph = NULL)
// Remove all triples from a graph
// CLEAR GRAPH ( <uri> | DEFAULT )
rdfdb_clear($graph = NULL)
// Create graph
// CREATE [ SILENT ] GRAPH <uri>
rdfdb_create($graph)
// Drop graph
// DROP [ SILENT ] GRAPH <uri>
rdfdb_drop($graph)
//// other potential candidates for API
check() // Check if the triplestore is up.
set($graph, $data) // create or replace the data in a graph.
add($graph, $data) // add the data in a graph.
delete($graph) // delete graph and its data
count($graph = NULL) // count how many triples in a graph/endpoint
queryRead($query, $typeoutput) // @see query()
queryReadJSON($query, $typeoutput)
queryReadTabSeparated($query, $typeoutput)
queryUpdate($query, $typeoutput)