Example #1
0
$author = array();
if (isset($_REQUEST["title"])) {
    $title = $_REQUEST["title"];
}
$sparql = new query_sparql();
$prefixs = "\n\t\tPREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>\n\t\tPREFIX cs: <http://purl.org/vocab/changeset/schema#>\n\t\tprefix owl: <http://www.w3.org/2002/07/owl#>\n\t\tPrefix sd: <http://www.semanticweb.org/francesco/ontologies/2016/docs#>\n\t\tprefix xsd: <http://www.w3.org/2001/XMLSchema#>\n\t\t\n\t\t";
//estraggo topic
$query = $prefixs . $sparql->getTopicByTitle($title, $tn = "?topic_value");
$response = $http->sparqlQuery($query);
$json = json_decode($response, true);
$temp = $json["results"]["bindings"];
$topics = array();
foreach ($temp as $t) {
    array_push($topics, $t["topic_value"]["value"]);
}
$article->setTopic($topics);
//estraggo keyword
$query = $prefixs . $sparql->getKeywordsByTitle($title, '?keyword_value');
$response = $http->sparqlQuery($query);
$json = json_decode($response, true);
$temp = $json["results"]["bindings"];
$Keywords = array();
foreach ($temp as $t) {
    array_push($keywords, $t["keyword_value"]["value"]);
}
$article->setKeyword($keywords);
//estraggo journal e anno
$query = $prefixs . $sparql->getJournalAndAnnoByArticle($title);
$response = $http->sparqlQuery($query);
$json = json_decode($response, true);
$temp = $json["results"]["bindings"];