01: /*
02: * LICENSE INFORMATION
03: * Copyright 2005-2007 by FZI (http://www.fzi.de).
04: * Licensed under a BSD license (http://www.opensource.org/licenses/bsd-license.php)
05: * <OWNER> = Max Völkel
06: * <ORGANIZATION> = FZI Forschungszentrum Informatik Karlsruhe, Karlsruhe, Germany
07: * <YEAR> = 2007
08: *
09: * Project information at http://semweb4j.org/rdf2go
10: */
11: package org.ontoware.rdf2go.model;
12:
13: import org.ontoware.aifbcommons.collection.ClosableIterator;
14: import org.ontoware.rdf2go.exception.ModelRuntimeException;
15: import org.ontoware.rdf2go.model.node.NodeOrVariable;
16: import org.ontoware.rdf2go.model.node.ResourceOrVariable;
17: import org.ontoware.rdf2go.model.node.UriOrVariable;
18:
19: /**
20: *
21: * @author voelkel
22: */
23: public interface FindableModelSet {
24:
25: /**
26: * Search across all existing models
27: *
28: * @param contextURI
29: * @param subject
30: * @param predicate
31: * @param object
32: * @return
33: * @throws ModelRuntimeException
34: */
35: ClosableIterator<Statement> findStatements(
36: UriOrVariable contextURI, ResourceOrVariable subject,
37: UriOrVariable predicate, NodeOrVariable object)
38: throws ModelRuntimeException;
39:
40: /**
41: * Search across all existing models and retunrs all statements matching the
42: * quad pattern
43: *
44: * @param pattern
45: * @return
46: * @throws ModelRuntimeException
47: */
48: ClosableIterator<Statement> findStatements(QuadPattern pattern)
49: throws ModelRuntimeException;
50:
51: /**
52: * @param contextURI
53: * @param subject
54: * @param predicate
55: * @param object
56: * @return true, if a Model named 'contextURI' contains the statement
57: * (s,p,o)
58: * @throws ModelRuntimeException
59: */
60: boolean containsStatements(UriOrVariable contextURI,
61: ResourceOrVariable subject, UriOrVariable predicate,
62: NodeOrVariable object) throws ModelRuntimeException;
63:
64: /**
65: * @param s
66: * a Statement
67: * @return true if the modelset contains a model with context s.getContext()
68: * which contains the statement s. If the context is null, the
69: * default graph is checked.
70: * @throws ModelRuntimeException
71: */
72: boolean contains(Statement s) throws ModelRuntimeException;
73:
74: /**
75: * @param pattern
76: * @return the number of statements matchingthe pattern. This is for all
77: * graphs matching the context of the pattern (this is none, one or
78: * all graphs). In matching graphs the number of matching statements
79: * is accumulated and returned.
80: * @throws ModelRuntimeException
81: */
82: long countStatements(QuadPattern pattern)
83: throws ModelRuntimeException;
84:
85: /**
86: * @param context
87: * @param subject
88: * @param predicate
89: * @param object
90: * @return a QuadPattern
91: */
92: QuadPattern createQuadPattern(UriOrVariable context,
93: ResourceOrVariable subject, UriOrVariable predicate,
94: NodeOrVariable object);
95:
96: }
|