Exemplo n.º 1
0
<?php

require_once 'http_API.php';
require_once 'query.php';
$http = new http_API();
$author = "John Darlington";
$year = null;
$topics = array();
$article1 = array();
$article2 = array();
$article3 = array();
$control = 0;
$title = "A decomposition theorem for finite persistent transition systems";
//$title="Fault diagnosis for nonlinear systems using a bank of neural estimators";
//$title="Parallel Integer Sorting and Simulation Amongst CRCW Models";
$sparql = new query_sparql();
$prefixs = "\r\nPREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>\r\nPREFIX cs: <http://purl.org/vocab/changeset/schema#>\r\nprefix owl: <http://www.w3.org/2002/07/owl#>\r\nPrefix sd: <http://www.semanticweb.org/francesco/ontologies/2016/docs#>\r\nprefix xsd: <http://www.w3.org/2001/XMLSchema#>\r\n";
//DATO UN AUTORE RESTITUISCE GLI ARTICOLI
/*$query=$prefixs.$sparql->getArticlesByAuthors("Norbert Blum");
$response = $http->sparqlQuery($query);
$json = json_decode($response,true);
$temp= $json["results"]["bindings"];

foreach($temp as $t){
        echo $t["name_author"]["value"]."<br>";
}*/
//Dato un journal restituire tutti gli articoli
$query = $prefixs . $sparql->getArticlesByJournal("Acta Inf.");
$response = $http->sparqlQuery($query);
$json = json_decode($response, true);
$temp = $json["results"]["bindings"];
Exemplo n.º 2
0
	<?php 
require_once 'http_API.php';
require_once 'query.php';
error_reporting(E_ERROR | E_PARSE);
$http = new http_API();
$sparql = new query_sparql();
$prefixs = "\n\tPREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>\n\tPREFIX cs: <http://purl.org/vocab/changeset/schema#>\n\tprefix owl: <http://www.w3.org/2002/07/owl#>\n\tPrefix sd: <http://www.semanticweb.org/francesco/ontologies/2016/docs#>\n\tprefix xsd: <http://www.w3.org/2001/XMLSchema#>\n\t\n\t";
$title = array();
$query = $prefixs . $sparql->getTitle();
$response = $http->sparqlQuery($query);
$json = json_decode($response, true);
$temp = $json["results"]["bindings"];
foreach ($temp as $t) {
    array_push($title, $t["titleValue"]["value"]);
}
$json_result = json_encode($title);
echo $json_result;
?>
		
		
Exemplo n.º 3
0
$topics = array();
$article1 = array();
$article2 = array();
$article3 = array();
$control = 0;
$equalsTopics = array();
if (isset($_REQUEST["title"])) {
    // Se è settato il titolo
    $title = $_REQUEST["title"];
    if (isset($_REQUEST["topics"])) {
        $topics = $_REQUEST["topics"];
    }
    if (isset($_REQUEST["keywords"])) {
        $keywords = $_REQUEST["keywords"];
    }
    $sparql = new query_sparql();
    $prefixs = "\n\tPREFIX crm: <http://www.cidoc-crm.org/cidoc-crm/>\n\tPREFIX cs: <http://purl.org/vocab/changeset/schema#>\n\tprefix owl: <http://www.w3.org/2002/07/owl#>\n\tPrefix sd: <http://www.semanticweb.org/francesco/ontologies/2016/docs#>\n\tprefix xsd: <http://www.w3.org/2001/XMLSchema#>\n\t\n\t";
    //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
    //A PARTIRE DAL TITOLO RESTITUISCE TOPIC E KEYWORD
    //if(!isset($title)){
    $query = $prefixs . $sparql->getTopicByTitle($title, $tn = "?topic_value");
    $response = $http->sparqlQuery($query);
    $json = json_decode($response, true);
    $temp = $json["results"]["bindings"];
    foreach ($temp as $t) {
        array_push($topics, $t["topic_value"]["value"]);
        //}
    }
    if ($control == 1) {
        //STAMPA I TOPIC DELL ARTICOLO DATO IN INPUT
        echo "----------------------TOPIC----------------------<br>";
Exemplo n.º 4
0
        $this->keyword = $keyword;
    }
    public function setUrl($url)
    {
        $this->url = $url;
    }
}
$http = new http_API();
$article = new Article();
$topics = array();
$keywords = array();
$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);
Exemplo n.º 5
0
<?php

require_once 'http_API.php';
require_once 'query.php';
error_reporting(E_ERROR | E_PARSE);
$http = new http_API();
if (isset($_REQUEST["title"])) {
    $title = $_REQUEST["title"];
}
$prefixs = "\n\t\t\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";
$sparql = new query_sparql();
//estraggo URL
$query = $prefixs . $sparql->getUrlByTitle($title);
$response = $http->sparqlQuery($query);
$json = json_decode($response, true);
$temp = $json["results"]["bindings"];
foreach ($temp as $t) {
    $url = $t["url_value"]["value"];
}
$json_result = json_encode($url);
echo $json_result;