query($q); if (!$s->getErrors()) { $index_returned_query_type = [ 'construct', 'describe' ]; $result = (in_array($rs['query_type'], $index_returned_query_type)) ? $rs : $rs['result']['rows']; if ($vd) { var_dump($result); exit(); } return $result; } else { var_dump($s->getErrors()); exit(); } } $config = array( 'db_host' => 'localhost', 'db_name' => $infos['db_name'], 'db_user' => $infos['db_user'], 'db_pwd' => $infos['db_pwd'], 'store_name' => $infos['store_name'], 'max_errors' => 1, 'store_write_buffer' => 40000 ); /** namespace prefixes */ $ns = array( 'dcterms' => 'http://purl.org/dc/terms/', 'ecrm' => 'http://erlangen-crm.org/current/', 'geo' => 'http://www.opengis.net/ont/geosparql#', 'owl' => 'http://www.w3.org/2002/07/owl#', 'qdmtl' => 'http://onto.qdmtl.ca/', 'rdfs' => 'http://www.w3.org/2000/01/rdf-schema#', 'rico' => 'https://www.ica.org/standards/RiC/ontology#', 'schema' => 'https://schema.org/', 'skos' => 'http://www.w3.org/2004/02/skos/core#' ); $ns_config = array('ns' => $ns); /** instantiation */ $store = ARC2::getStore($config); $rdf_xml_serializer = ARC2::getRDFXMLSerializer($ns_config); // $store->createDBCon(); if (!$store->isSetUp()) { $store->setUp(); } $q = 'PREFIX skos: CONSTRUCT{?s ?p ?o}WHERE{?s a skos:Concept;?p ?o.}'; $triples = use_path_to_query($q, $store); if (!$triples['result']) { echo "SPARQL query returned 0 result"; exit(); } /** RDF/XML */ $rdf_xml_serialization = $rdf_xml_serializer->getSerializedIndex($triples['result']); header('Content-type: text/xml'); echo $rdf_xml_serialization; ?>