<?php

$query 
"
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX sioc:   <http://rdfs.org/sioc/ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>  
PREFIX dcterms: <http://purl.org/dc/terms/>  
PREFIX content: <http://purl.org/rss/1.0/modules/content/>

SELECT ?start ?title ?link ?content ?name
WHERE {
  ?link dc:title ?title .
  ?link dcterms:created ?start .
  ?link sioc:has_creator ?_y .
  ?link content:encoded ?content .
  ?_y sioc:name ?user .
  OPTIONAL { ?_z sioc:has_reply ?link }
  FILTER (!bound(?_z))
}
ORDER BY ?start
"
;

echo 
file_get_contents('http://localhost:2020/sparql?query=' urlencode($query) . '&output=json');

?>