Java源码示例:com.hp.hpl.jena.graph.Graph

示例1
private void reload() {
	loader.getMapping().connect();
	Graph graph = loader.getGraphD2RQ();
	
	datasetGraph = DatasetGraphFactory.createOneGraph(graph);
	defaultModel = ModelFactory.createModelForGraph(datasetGraph.getDefaultGraph());		

	hasTruncatedResults = false;
	for (SQLConnection db: loader.getMapping().getSQLConnections()) {
		if (db.limit() != Database.NO_LIMIT) {
			hasTruncatedResults = true;
		}
	}

	if (autoReload) {
		lastModified = watchedFile.lastModified();
		lastReload = System.currentTimeMillis();
	}
}
 
示例2
@Override
public void load(
		final SolrQueryRequest request, 
		final SolrQueryResponse response,
		final ContentStream stream, 
		final UpdateRequestProcessor processor) throws Exception {
	
	final PipedRDFIterator<Triple> iterator = new PipedRDFIterator<Triple>();
	final StreamRDF inputStream = new PipedTriplesStream(iterator);
	
	executor.submit(new Runnable() {
		@Override
		public void run() {
			try {
				RDFDataMgr.parse(
						inputStream, 
						stream.getStream(), 
						RDFLanguages.contentTypeToLang(stream.getContentType()));
			} catch (final IOException exception) {
				throw new SolrException(ErrorCode.SERVER_ERROR, exception);
			}					
		}
	});
		
	// Graph Store Protocol indicates the target graph URI separately.
	// So the incoming Content-type here is one that maps "Triples Loader" but
	// the indexed tuple could be a Quad.
	final String graphUri = request.getParams().get(Names.GRAPH_URI_ATTRIBUTE_NAME);
	
	final DatasetGraph dataset = new LocalDatasetGraph(request, response, null, null);
	final Graph defaultGraph = graphUri == null 
			? dataset.getDefaultGraph() 
			: dataset.getGraph(NodeFactory.createURI(graphUri));
	while (iterator.hasNext()) {
		defaultGraph.add(iterator.next());
	}		
}
 
示例3
public Graph getAdditionalTriples() {
	return GraphFactory.createPlainGraph();
}
 
示例4
public Graph getGraphD2RQ() {
	if (dataGraph == null) {
		dataGraph = new GeneralGraphD2RQ(getMapping());
	}
	return dataGraph;
}
 
示例5
public Graph getGraphD2RQ() {
	if (dataGraph == null) {
		dataGraph = new GraphD2RQ(getMapping());
	}
	return dataGraph;
}
 
示例6
public void setAdditionalTriples(Graph graph) {
	additionalTriples = graph;
}
 
示例7
public Graph getAdditionalTriples() {
	return additionalTriples;
}
 
示例8
public Graph getAdditionalTriples() {
	return GraphFactory.createPlainGraph();
}
 
示例9
public D2RQQueryHandler(Graph graph) {
	super(graph);
	dataset = DatasetGraphFactory.createOneGraph(graph);
}
 
示例10
public TreeQueryPlan prepareTree(Graph pattern) {
	throw new RuntimeException("prepareTree - Andy says Chris says this will not be called");
}
 
示例11
public Graph description() {
	if (executed) return result;
	executed = true;

	ExecutionContext context = new ExecutionContext(
			mapping.getContext(), null, null, null);
	final QueryIterConcat qIter = new QueryIterConcat(context);
	Pingback<?> pingback = null;
	if (timeout > 0) {
		pingback = AlarmClock.get().add(new Callback<Object>() {
			public void proc(Object ignore) {
				qIter.cancel();
			}
		}, timeout);
	}
	
	FindQuery outgoing = new FindQuery(
			Triple.create(node, Node.ANY, Node.ANY), 
			mapping.getTripleRelations(), limit, context);
	qIter.add(outgoing.iterator());
	
	if (!onlyOutgoing) {
		FindQuery incoming = new FindQuery(
				Triple.create(Node.ANY, Node.ANY, node), 
				mapping.getTripleRelations(), limit, context);
		qIter.add(incoming.iterator());

		FindQuery triples = new FindQuery(
				Triple.create(Node.ANY, node, Node.ANY), 
				mapping.getTripleRelations(), limit, context);
		qIter.add(triples.iterator());
	}
	Iterator<Triple> it = TripleQueryIter.create(qIter);
	while (it.hasNext()) {
		result.add(it.next());
	}
	
	if (pingback != null) {
		AlarmClock.get().cancel(pingback);
	}
	
	return result;
}
 
示例12
@Override
public boolean dependsOn(Graph arg0) {
	throw new RuntimeException(new MethodNotSupportedException("dependsOn"));
}
 
示例13
@Override
public boolean isIsomorphicWith(Graph arg0) {
	throw new RuntimeException(new MethodNotSupportedException("isIsomorphic"));
}
 
示例14
public Graph addDescription(Graph arg0, Node arg1) {
	// TODO Auto-generated method stub
	return null;
}
 
示例15
@Override
public Graph createGraph() {
	// TODO Auto-generated method stub
	return neoGraph;
}
 
示例16
@Override
public Graph createGraph(String arg0) {
	// TODO Auto-generated method stub
	
	return null;
}
 
示例17
@Override
public Graph createGraph(String arg0, boolean arg1) {
	// TODO Auto-generated method stub
	return null;
}
 
示例18
public Graph getDescription() {
	// TODO Auto-generated method stub
	return null;
}
 
示例19
public Graph getDescription(Node arg0) {
	// TODO Auto-generated method stub
	return null;
}
 
示例20
@Override
public Graph getGraph() {
	// TODO Auto-generated method stub
	return null;
}
 
示例21
@Override
public Graph openGraph() {
	// TODO Auto-generated method stub
	return null;
}
 
示例22
@Override
public Graph openGraph(String arg0) {
	// TODO Auto-generated method stub
	return null;
}
 
示例23
@Override
public Graph openGraph(String arg0, boolean arg1) {
	// TODO Auto-generated method stub
	return null;
}
 
示例24
public UniqueRelationshipFactory(GraphDatabaseService graphdb, Graph graph) {
	//this.graphdb = graphdb;
	this.graph = graph;
}
 
示例25
@Override
public boolean dependsOn(Graph arg0) {
	// TODO Auto-generated method stub
	return false;
}
 
示例26
@Override
public boolean isIsomorphicWith(Graph arg0) {
	// TODO Auto-generated method stub
	return false;
}
 
示例27
@Override
protected Graph _createNamedGraph(final Node graphNode) {
	return LocalGraph.readableAndWritableGraph(graphNode, request, response, qParser, listener);
}
 
示例28
@Override
protected Graph _createDefaultGraph() {
	return LocalGraph.readableAndWritableGraph(null, request, response, qParser, listener);
}
 
示例29
@Override
protected Graph _createNamedGraph(final Node graphNode) {
	return new CloudGraph(graphNode, cloud, CloudGraph.DEFAULT_QUERY_FETCH_SIZE, listener);
}
 
示例30
@Override
protected Graph _createDefaultGraph() {
	return new CloudGraph(null, cloud, CloudGraph.DEFAULT_QUERY_FETCH_SIZE, listener);
}