Beispiel #1
0
include_once "../include.php";
require_once "connect.php";
function add_datavalue($arr, $dv)
{
    $LNK = "http://m.push2press.com/kitchensink/plugins/connectors/wikidata/getpage.php?q";
    if ($dv["type"] == "wikibase-entityid") {
        array_push($arr, "pg:(LINK TO ENTITY ID " . $dv["value"]["numeric-id"] . ")," . $LNK . "=q" . $dv["value"]["numeric-id"]);
    } else {
        if ($dv["type"] == "string") {
            array_push($arr, "p:STRING VALUE : " . $dv["value"]);
        }
    }
    return $arr;
}
$f = new wikidata("");
$q = $_GET['q'];
if ($q == "") {
    $q = "Q35127";
}
$res = $f->getpage($q);
$retval = new obj();
$retval->status = 0;
$retval->statusMsg = sprintf("success");
$retval->data = $res;
$retval->url = $f->url;
$arr = array();
$arrsummary = array();
foreach ($res["entities"] as $key => $value) {
    array_push($arrsummary, "h1:" . $key);
    array_push($arrsummary, "p:pageid: " . $value["pageid"]);
Beispiel #2
0
<?php

include_once "../include.php";
require_once "connect.php";
$f = new wikidata("");
$q = $_GET['q'];
if ($q == "") {
    $q = "Q35127";
}
$res = $f->getclaim($q);
$retval = new obj();
$retval->status = 0;
$retval->statusMsg = sprintf("success");
$retval->data = $res;
$retval->url = $f->url;
$arr = array();
array_push($arr, "h1:" . $q);
/*
$arrsummary = array();
foreach($res["entities"] as $key=>$value) {
	array_push($arrsummary,"h1:".$key);
	array_push($arrsummary,"p:pageid: ".$value["pageid"]);
	array_push($arrsummary,"p:title: ".$value["title"]);
	array_push($arr,"h1:".$key);
	array_push($arr,"p:pageid: ".$value["pageid"]);
	array_push($arr,"p:ns: ".$value["ns"]);
	array_push($arr,"p:title: ".$value["title"]);
	array_push($arr,"p:lastrevid: ".$value["lastrevid"]);
	array_push($arr,"p:id: ".$value["id"]);
	array_push($arr,"p:type: ".$value["type"]);
	array_push($arr,"h1:\n\nCLAIMS");