Apache-SPARQL-RDFStore

 view release on metacpan or  search on metacpan

lib/Apache/SPARQL/RDFStore.pm  view on Meta::CPAN

			};
		} @params;

	# merge graph-id/s and 
	#if( $class->_SPARQLhas_Source( $query ) ) {
	#} else {
	#	};
	my $data = new RDFStore::Model;
	if($graph_id) {
		foreach my $graph_id ( @{ $graph_id } ) {
			# bad - try to guess out format from file extension
			eval {
				$data->getReader( ($graph_id =~ /\.(nt|ntriples)$/) ? 'N-Triples' : 'RDF/XML' )->parsestring(
					$class->_cat( $ap, $graph_id ) );
				};
			if($@) {
        			$class->_error( $ap, "Cannot process graph-id $graph_id: $@ " );
				return $Apache::SPARQL::Responses{ 'OperationPointError' };
				};
			};
		};

lib/Apache/SPARQL/RDFStore.pm  view on Meta::CPAN

				};
			};
	} else {
		# prepare to output things
		$ap->content_type( $class->_get_content_type( $format ) );

		if (! $class->_mp2 ) {
			$ap->send_http_header();
			};

		# we need to reject output-xslt param here I guess

		if( $format eq 'rdfxml' ) {
			$serialization_format = 'RDF/XML';
		} elsif( $format eq 'xml' ) {
			$sth->finish;
			$class->_error( $ap, "XML output is not possible but SELECT queries" );
			return $Apache::SPARQL::Responses{ 'OperationPointError' };
		} elsif( $format eq 'ntriples' ) {
			$serialization_format = 'N-Triples';
			};



( run in 0.333 second using v1.01-cache-2.11-cpan-702932259ff )