本文整理匯總了Java中org.openrdf.query.TupleQueryResult.next方法的典型用法代碼示例。如果您正苦於以下問題:Java TupleQueryResult.next方法的具體用法?Java TupleQueryResult.next怎麽用?Java TupleQueryResult.next使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.openrdf.query.TupleQueryResult
的用法示例。
在下文中一共展示了TupleQueryResult.next方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: testDoubleFirstArgumentWrongType
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testDoubleFirstArgumentWrongType() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?result where { bind(ss:doubleMetaphone(7) as ?result) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例2: testSorensenDiceTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testSorensenDiceTooManyArgs() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?str where { bind(ss:sorensenDice(\"one\", \"two\", \"three\", \"four\") as ?str) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例3: testSorensenDiceWrongType
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testSorensenDiceWrongType() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?str where { bind(ss:sorensenDice(7) as ?str) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例4: testSecondArgumentWrongType
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testSecondArgumentWrongType() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?result where { bind(ss:damerau(\"Stardog\", 7) as ?result) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例5: testLevenshteinWrongType
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testLevenshteinWrongType() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?str where { bind(ss:levenshtein(7) as ?str) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例6: testMetaphoneTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testMetaphoneTooManyArgs() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?metaphone where { bind(ss:metaphone(\"one\", \"two\", \"three\", \"four\") as ?metaphone) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例7: testSoundexTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testSoundexTooManyArgs() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?soundex where { bind(ss:soundex(\"one\", \"two\", \"three\", \"four\") as ?soundex) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例8: testMetricLongestCommonSubsequenceTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testMetricLongestCommonSubsequenceTooManyArgs() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?str where { bind(ss:metricLongestCommonSubsequence(\"one\", \"two\", \"three\") as ?str) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
開發者ID:semantalytics,項目名稱:stardog-plugin-string-similarity,代碼行數:32,代碼來源:TestMetricLongestCommonSubsequence.java
示例9: testQGramTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testQGramTooManyArgs() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?str where { bind(ss:qgram(\"one\", \"two\", \"three\", \"four\") as ?str) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例10: testTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testTooManyArgs() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?result where { bind(ss:doubleMetaphone(\"one\", \"two\", \"three\", \"four\") as ?result) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例11: testMetaphoneWrongType
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testMetaphoneWrongType() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?metaphone where { bind(ss:metaphone(7) as ?metaphone) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例12: testCosineWrongTypeSecondArg
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testCosineWrongTypeSecondArg() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + ">" +
"select ?result where { bind(ss:cosine(\"Stardog\", 2) as ?result) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例13: testTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testTooManyArgs() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?result where { bind(ss:daitchMokotoffSoundex(\"one\", \"two\") as ?result) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
開發者ID:semantalytics,項目名稱:stardog-plugin-string-similarity,代碼行數:32,代碼來源:TestDaitchMokitoffSoundex.java
示例14: testWrongType
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testWrongType() throws Exception {
final Connection aConn = ConnectionConfiguration.to(DB)
.credentials("admin", "admin")
.connect();
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?result where { bind(ss:nysiis(7) as ?result) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}
示例15: testSmithWatermanGotohTooManyArgs
import org.openrdf.query.TupleQueryResult; //導入方法依賴的package包/類
@Test
public void testSmithWatermanGotohTooManyArgs() throws Exception {
try {
final String aQuery = "prefix ss: <" + StringSimilarityVocab.NAMESPACE + "> " +
"select ?dist where { bind(ss:smithWatermanGotoh(\"one\", \"two\", \"three\", \"four\") as ?dist) }";
final TupleQueryResult aResult = aConn.select(aQuery).execute();
try {
// there should be a result because implicit in the query is the singleton set, so because the bind
// should fail due to the value error, we expect a single empty binding
assertTrue("Should have a result", aResult.hasNext());
final BindingSet aBindingSet = aResult.next();
assertTrue("Should have no bindings", aBindingSet.getBindingNames().isEmpty());
assertFalse("Should have no more results", aResult.hasNext());
}
finally {
aResult.close();
}
}
finally {
aConn.close();
}
}