From: <tho...@us...> - 2013-12-30 12:27:41
|
Revision: 7695 http://bigdata.svn.sourceforge.net/bigdata/?rev=7695&view=rev Author: thompsonbry Date: 2013-12-30 12:27:34 +0000 (Mon, 30 Dec 2013) Log Message: ----------- more javadoc on bds:search. Modified Paths: -------------- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/store/BDS.java Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-12-30 12:02:34 UTC (rev 7694) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/sparql/ast/eval/SliceServiceFactory.java 2013-12-30 12:27:34 UTC (rev 7695) @@ -68,7 +68,6 @@ import com.bigdata.rdf.sparql.ast.service.ServiceFactory; import com.bigdata.rdf.sparql.ast.service.ServiceNode; import com.bigdata.rdf.spo.DistinctMultiTermAdvancer; -import com.bigdata.rdf.spo.DistinctTermAdvancer; import com.bigdata.rdf.spo.ISPO; import com.bigdata.rdf.spo.SPO; import com.bigdata.rdf.spo.SPOKeyOrder; @@ -82,7 +81,7 @@ /** * A factory for a statement pattern slicing service. * It accepts a group with a single triple pattern in it: - * + * <pre> * service bd:slice { * ?s rdf:type ex:Foo . * @@ -93,7 +92,7 @@ * # or range * bd:serviceParam bd:slice.range ?range * } - * + * </pre> * The service params are required and set the slicing parameters. You can * either request a slice or request a range count depending on the params. * The range count is useful when dealing with a "rangeSafe" predicate with Modified: branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/store/BDS.java =================================================================== --- branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/store/BDS.java 2013-12-30 12:02:34 UTC (rev 7694) +++ branches/BIGDATA_RELEASE_1_3_0/bigdata-rdf/src/java/com/bigdata/rdf/store/BDS.java 2013-12-30 12:27:34 UTC (rev 7695) @@ -31,10 +31,19 @@ import org.openrdf.model.URI; import org.openrdf.model.impl.URIImpl; +import com.bigdata.rdf.sparql.ast.eval.SliceServiceFactory; + /** - * A vocabulary for bigdata specific extensions. + * A vocabulary for the bigdata full text search facility. Full text search may + * be used to combine text search and graph search. Low-latency, user facing + * search applications may be created by slicing the full text search results + * and feeding them incrementally into SPARQL queries. This approach allows the + * application to manage the cost of the SPARQL query by bounding the input. If + * necessary, additional results can be feed into the query. * + * @see SliceServiceFactory + * * @see <a * href="http://sourceforge.net/apps/mediawiki/bigdata/index.php?title=FullTextSearch"> * Free Text Index </a> @@ -55,8 +64,8 @@ final String NAMESPACE = "http://www.bigdata.com/rdf/search#"; /** - * The name of a magic predicate recognized by the {@link com.bigdata.rdf.sail.BigdataSail} when - * it occurs in statement patterns such as: + * The name of a magic predicate recognized in SPARQL queries when it occurs + * in statement patterns such as: * * <pre> * @@ -64,25 +73,25 @@ * * </pre> * - * The value MUST be bound and MUST be a literal. The languageCode attribute - * is permitted, but a datatype attribute is not allowed. When specified, - * the languageCode attribute will be used to determine how the literal is - * tokenized - it does not filter for matches marked with that languageCode - * attribute. + * The value MUST be bound and MUST be a literal. The + * <code>languageCode</code> attribute is permitted. When specified, the + * <code>languageCode</code> attribute will be used to determine how the + * literal is tokenized - it does not filter for matches marked with that + * <code>languageCode</code> attribute. The <code>datatype</code> attribute + * is not allowed. * <p> - * The subject MUST NOT be bound. + * The subject MUST NOT be bound. * <p> * * This expression will evaluate to a set of bindings for the subject - * position corresponding to the indexed literals matching any of the - * terms obtained when the literal was tokenized. + * position corresponding to the indexed literals matching any of the terms + * obtained when the literal was tokenized. * * <p> * Note: The context position should be unbound when using statement * identifiers. */ -// URI SEARCH = new URIImpl(NAMESPACE+"search"); - final URI SEARCH = new URIImpl(NAMESPACE+"search"); + final URI SEARCH = new URIImpl(NAMESPACE + "search"); /** * Magic predicate used to query for free text search metadata, reporting @@ -100,17 +109,22 @@ * * </pre> * + * Relevance is the cosine of the angle between the query vector (search + * terms) and the document vector (terms in the indexed literals). The + * minimum relevance is ZERO (0.0). The maximum relevance is ONE (1.0). + * * @see #MIN_RELEVANCE * @see #MAX_RELEVANCE */ - final URI RELEVANCE = new URIImpl(NAMESPACE+"relevance"); + final URI RELEVANCE = new URIImpl(NAMESPACE + "relevance"); /** * Magic predicate used to query for free text search metadata, reporting * the rank (origin ONE (1)) of the search result amoung the search results * obtained for the search query. The rank is from ONE to N, where N is the - * number of search results from the full text index. Use in conjunction - * with {@link #SEARCH} as follows: + * number of search results from the full text index. {@link #MIN_RANK} and + * {@link #MAX_RANK} may be used to "slice" the full text index search + * results. Use this query hint conjunction with {@link #SEARCH} as follows: * <p> * * <pre> @@ -126,7 +140,7 @@ * @see #MIN_RANK * @see #MAX_RANK */ - final URI RANK = new URIImpl(NAMESPACE+"rank"); + final URI RANK = new URIImpl(NAMESPACE + "rank"); /** * Magic predicate used to limit the maximum rank of the free text search @@ -152,7 +166,7 @@ * feed the next "page" of free text results by changing the values for the * {@link #MIN_RANK} AND {@link #MAX_RANK} query hints. */ - final URI MAX_RANK = new URIImpl(NAMESPACE+"maxRank"); + final URI MAX_RANK = new URIImpl(NAMESPACE + "maxRank"); /** * The default for {@link #MAX_RANK}. @@ -177,7 +191,7 @@ * * The default is {@value #DEFAULT_MIN_RANK}. */ - final URI MIN_RANK = new URIImpl(NAMESPACE+"minRank"); + final URI MIN_RANK = new URIImpl(NAMESPACE + "minRank"); /** * The default for {@link #MIN_RANK} is 1, full text search results will @@ -185,58 +199,66 @@ */ final int DEFAULT_MIN_RANK = 1; - /** - * Magic predicate used to query for free text search metadata. Use in - * conjunction with {@link #SEARCH} as follows: - * <p> - * - * <pre> - * - * select ?s - * where { - * ?s bd:search "scale-out RDF triplestore" . - * ?s bd:minRelevance "0.5"^^xsd:double . - * } - * - * </pre> - * - * The relevance scores are in [0.0:1.0]. You should NOT specify a minimum - * relevance of ZERO (0.0) as this can drag in way too many unrelated - * results. The default is {@value #DEFAULT_MIN_RELEVANCE}. - */ - final URI MIN_RELEVANCE = new URIImpl(NAMESPACE+"minRelevance"); + /** + * Magic predicate used to query for free text search metadata. Use in + * conjunction with {@link #SEARCH} as follows: + * <p> + * + * <pre> + * + * select ?s + * where { + * ?s bd:search "scale-out RDF triplestore" . + * ?s bd:minRelevance "0.5"^^xsd:double . + * } + * + * </pre> + * + * The relevance scores are in [0.0:1.0], where 0.0 is the minimum possible + * relevance and 1.0 is the maximum possible relevance. You should NOT + * specify a minimum relevance of ZERO (0.0) as this can drag in way too + * many unrelated results. The default is {@value #DEFAULT_MIN_RELEVANCE}. + */ + final URI MIN_RELEVANCE = new URIImpl(NAMESPACE + "minRelevance"); final double DEFAULT_MIN_RELEVANCE = 0.0d; - /** - * Magic predicate used to query for free text search metadata. Use in - * conjunction with {@link #SEARCH} as follows: - * <p> - * - * <pre> - * - * select ?s - * where { - * ?s bd:search "scale-out RDF triplestore" . - * ?s bd:maxRelevance "0.9"^^xsd:double . - * } - * - * </pre> - * - * The relevance scores are in [0.0:1.0]. The default maximum relevance is - * {@value #DEFAULT_MAX_RELEVANCE}. - */ - final URI MAX_RELEVANCE = new URIImpl(NAMESPACE+"maxRelevance"); + /** + * Magic predicate used to query for free text search metadata. Use in + * conjunction with {@link #SEARCH} as follows: + * <p> + * + * <pre> + * + * select ?s + * where { + * ?s bd:search "scale-out RDF triplestore" . + * ?s bd:maxRelevance "0.9"^^xsd:double . + * } + * + * </pre> + * + * The relevance scores are in [0.0:1.0], where 0.0 is the minimum possible + * relevance and 1.0 is the maximum possible relevance. You should NOT + * specify a minimum relevance of ZERO (0.0) as this can drag in way too + * many unrelated results. The default maximum relevance is + * {@value #DEFAULT_MAX_RELEVANCE}. + */ + final URI MAX_RELEVANCE = new URIImpl(NAMESPACE + "maxRelevance"); /** - * The default value for {@link #MAX_RELEVANCE} unless overridden. + * The default value for {@link #MAX_RELEVANCE} unless overridden. */ final double DEFAULT_MAX_RELEVANCE = 1.0d; /** - * Magic predicate used to query for free text search metadata. Use - * in conjunction with {@link #SEARCH} as follows: + * Magic predicate used to query for free text search metadata indicates + * that all terms in the query must be found within a given literal in order + * for that literal to "match" the query (default + * {@value #DEFAULT_MATCH_ALL_TERMS}). Use in conjunction with + * {@link #SEARCH} as follows: * <p> + * * <pre> * * select ?s @@ -247,14 +269,16 @@ * * </pre> */ - final URI MATCH_ALL_TERMS = new URIImpl(NAMESPACE+"matchAllTerms"); + final URI MATCH_ALL_TERMS = new URIImpl(NAMESPACE + "matchAllTerms"); final boolean DEFAULT_MATCH_ALL_TERMS = false; /** - * Magic predicate used to query for free text search metadata. Use - * in conjunction with {@link #SEARCH} as follows: + * Magic predicate used to query for free text search metadata indicates + * that only exact string matches will be reported (the literal must contain + * the search string). Use in conjunction with {@link #SEARCH} as follows: * <p> + * * <pre> * * select ?s @@ -268,14 +292,16 @@ * This operation will be rather expensive as it will require materializing * all the hits to check their values. */ - final URI MATCH_EXACT = new URIImpl(NAMESPACE+"matchExact"); + final URI MATCH_EXACT = new URIImpl(NAMESPACE + "matchExact"); final boolean DEFAULT_MATCH_EXACT = false; /** - * Magic predicate used to query for free text search metadata. Use - * in conjunction with {@link #SEARCH} as follows: + * Magic predicate used to query for free text search metadata indicates + * that only search results that also pass the specified REGEX filter will + * be reported. Use in conjunction with {@link #SEARCH} as follows: * <p> + * * <pre> * * select ?s @@ -289,14 +315,18 @@ * This operation will be rather expensive as it will require materializing * all the hits to check their values. */ - final URI MATCH_REGEX = new URIImpl(NAMESPACE+"matchRegex"); + final URI MATCH_REGEX = new URIImpl(NAMESPACE + "matchRegex"); final String DEFAULT_MATCH_REGEX = null; /** - * Magic predicate used to query for free text search metadata. Use - * in conjunction with {@link #SEARCH} as follows: + * Magic predicate used to query for free text search metadata to turn on + * prefix matching. Prefix matching will match all full text index tokens + * that begin with the specified token(s) (default + * {@value #DEFAULT_PREFIX_MATCH}). Use in conjunction with {@link #SEARCH} + * as follows: * <p> + * * <pre> * * select ?s @@ -309,7 +339,7 @@ * <p> * This will turn on prefix matching. */ - final URI PREFIX_MATCH = new URIImpl(NAMESPACE+"prefixMatch"); + final URI PREFIX_MATCH = new URIImpl(NAMESPACE + "prefixMatch"); final boolean DEFAULT_PREFIX_MATCH = false; @@ -330,20 +360,23 @@ * The subject-centric search index must be enabled via * {@link AbstractTripleStore.Options#SUBJECT_CENTRIC_TEXT_INDEX}. */ - final URI SUBJECT_SEARCH = new URIImpl(NAMESPACE+"subjectSearch"); + final URI SUBJECT_SEARCH = new URIImpl(NAMESPACE + "subjectSearch"); final boolean DEFAULT_SUBJECT_SEARCH = false; /** - * Magic predicate used for the "search in search" service. Also serves - * as the identifier for the service itself. + * Magic predicate used for the "search in search" service. Also serves as + * the identifier for the service itself. */ - final URI SEARCH_IN_SEARCH = new URIImpl(NAMESPACE+"searchInSearch"); - + final URI SEARCH_IN_SEARCH = new URIImpl(NAMESPACE + "searchInSearch"); + /** - * Magic predicate used to query for free text search metadata. Use - * in conjunction with {@link #SEARCH} as follows: + * Magic predicate used to query for free text search metadata to set a + * deadline in milliseconds on the full text index search ( + * {@value #DEFAULT_TIMEOUT}). Use in conjunction with {@link #SEARCH} as + * follows: * <p> + * * <pre> * * select ?s @@ -356,11 +389,11 @@ * <p> * Timeout specified in milliseconds. */ - final URI SEARCH_TIMEOUT = new URIImpl(NAMESPACE+"searchTimeout"); - + final URI SEARCH_TIMEOUT = new URIImpl(NAMESPACE + "searchTimeout"); + /** * The default timeout for a free text search (milliseconds). */ final long DEFAULT_TIMEOUT = Long.MAX_VALUE; - + } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |