本文整理汇总了Java中org.openrdf.model.vocabulary.RDFS.LABEL属性的典型用法代码示例。如果您正苦于以下问题:Java RDFS.LABEL属性的具体用法?Java RDFS.LABEL怎么用?Java RDFS.LABEL使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.openrdf.model.vocabulary.RDFS
的用法示例。
在下文中一共展示了RDFS.LABEL属性的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: finishLoading
@Override
protected void finishLoading( Properties props ) throws RepositoryException {
String realname = ( null == getEngineName()
? props.getProperty( Constants.ENGINE_NAME,
FilenameUtils.getBaseName( props.getProperty( Constants.SMSS_LOCATION ) ) )
: getEngineName() );
MetadataQuery mq = new MetadataQuery( RDFS.LABEL );
queryNoEx( mq );
String str = mq.getString();
if ( null != str ) {
realname = str;
}
setEngineName( realname );
RepositoryConnection rc = getRawConnection();
rc.begin();
for ( Map.Entry<String, String> en : Utility.DEFAULTNAMESPACES.entrySet() ) {
rc.setNamespace( en.getKey(), en.getValue() );
}
rc.commit();
}
示例2: testSearch
@Test
public void testSearch() throws Exception {
try (MongoFreeTextIndexer f = new MongoFreeTextIndexer()) {
f.setConf(conf);
f.init();
final ValueFactory vf = new ValueFactoryImpl();
final URI subject = new URIImpl("foo:subj");
final URI predicate = RDFS.LABEL;
final Value object = vf.createLiteral("this is a new hat");
final URI context = new URIImpl("foo:context");
final Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(RdfToRyaConversions.convertStatement(statement));
f.flush();
assertEquals(Sets.newHashSet(), getSet(f.queryText("asdf", EMPTY_CONSTRAINTS)));
assertEquals(Sets.newHashSet(statement), getSet(f.queryText("new", EMPTY_CONSTRAINTS)));
assertEquals(Sets.newHashSet(statement), getSet(f.queryText("hat new", EMPTY_CONSTRAINTS)));
}
}
示例3: getEngineLabel
public static String getEngineLabel( IEngine engine ) {
String label = engine.getEngineName();
MetadataQuery mq = new MetadataQuery( RDFS.LABEL );
engine.queryNoEx( mq );
String str = mq.getString();
if ( null != str ) {
label = str;
}
return label;
}
示例4: testCompare1
@Test
public void testCompare1() {
Statement o1 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "a" ) );
Statement o2 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "b" ) );
StatementSorter instance = new StatementSorter();
int result = instance.compare( o1, o2 );
assertTrue( result < 0 );
}
示例5: testCompare2
@Test
public void testCompare2() {
Statement o1 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "a" ) );
Statement o2 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "A" ) );
StatementSorter instance = new StatementSorter();
int result = instance.compare( o1, o2 );
assertTrue( result > 0 );
}
示例6: testCompare3
@Test
public void testCompare3() {
Statement o1 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "A" ) );
Statement o2 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "A" ) );
StatementSorter instance = new StatementSorter();
int result = instance.compare( o1, o2 );
assertEquals( 0, result );
}
示例7: testCompare4
@Test
public void testCompare4() {
Statement o1 = new StatementImpl( RDFS.LABEL, RDFS.CLASS, new LiteralImpl( "A" ) );
Statement o2 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "A" ) );
StatementSorter instance = new StatementSorter();
int result = instance.compare( o1, o2 );
assertTrue( result < 0 );
}
示例8: testCompare5
@Test
public void testCompare5() {
Statement o1 = new StatementImpl( RDFS.CLASS, RDFS.LABEL, new LiteralImpl( "A" ) );
Statement o2 = new StatementImpl( RDFS.LABEL, RDFS.LABEL, new LiteralImpl( "A" ) );
StatementSorter instance = new StatementSorter();
int result = instance.compare( o1, o2 );
assertTrue( result < 0 );
}
示例9: PropComparator
public PropComparator() {
this( RDFS.LABEL, RDF.TYPE, RDF.SUBJECT );
}
示例10: testDelete
@Test
public void testDelete() throws Exception {
try (MongoFreeTextIndexer f = new MongoFreeTextIndexer()) {
f.setConf(conf);
f.init();
final ValueFactory vf = new ValueFactoryImpl();
final URI subject1 = new URIImpl("foo:subj");
final URI predicate1 = RDFS.LABEL;
final Value object1 = vf.createLiteral("this is a new hat");
final URI context1 = new URIImpl("foo:context");
final Statement statement1 = vf.createStatement(subject1, predicate1, object1, context1);
f.storeStatement(RdfToRyaConversions.convertStatement(statement1));
final URI subject2 = new URIImpl("foo:subject");
final URI predicate2 = RDFS.LABEL;
final Value object2 = vf.createLiteral("Do you like my new hat?");
final URI context2 = new URIImpl("foo:context");
final Statement statement2 = vf.createStatement(subject2, predicate2, object2, context2);
f.storeStatement(RdfToRyaConversions.convertStatement(statement2));
f.flush();
f.deleteStatement(RdfToRyaConversions.convertStatement(statement1));
assertEquals(Sets.newHashSet(statement2), getSet(f.queryText("Do you like my new hat?", EMPTY_CONSTRAINTS)));
// Check that "new" didn't get deleted from the term table after "this is a new hat"
// was deleted since "new" is still in "Do you like my new hat?"
assertEquals(Sets.newHashSet(statement2), getSet(f.queryText("new", EMPTY_CONSTRAINTS)));
f.deleteStatement(RdfToRyaConversions.convertStatement(statement2));
assertEquals(Sets.newHashSet(), getSet(f.queryText("this is a new hat", EMPTY_CONSTRAINTS)));
assertEquals(Sets.newHashSet(), getSet(f.queryText("Do you like my new hat?", EMPTY_CONSTRAINTS)));
}
}
示例11: testSearch
@Test
public void testSearch() throws Exception {
try (AccumuloFreeTextIndexer f = new AccumuloFreeTextIndexer()) {
f.setConf(conf);
f.setMultiTableBatchWriter(ConfigUtils.createMultitableBatchWriter(conf));
f.init();
ValueFactory vf = new ValueFactoryImpl();
URI subject = new URIImpl("foo:subj");
URI predicate = RDFS.LABEL;
Value object = vf.createLiteral("this is a new hat");
URI context = new URIImpl("foo:context");
Statement statement = vf.createStatement(subject, predicate, object, context);
f.storeStatement(RdfToRyaConversions.convertStatement(statement));
f.flush();
printTables(conf);
Assert.assertEquals(Sets.newHashSet(), getSet(f.queryText("asdf", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(), getSet(f.queryText("this & !is", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("this", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("is", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("a", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("new", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("hat", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("ha*", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("*at", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("hat & new", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement), getSet(f.queryText("this & hat & new", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(), getSet(f.queryText("bat", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(), getSet(f.queryText("this & bat", EMPTY_CONSTRAINTS)));
}
}
示例12: testDelete
@Test
public void testDelete() throws Exception {
try (AccumuloFreeTextIndexer f = new AccumuloFreeTextIndexer()) {
f.setConf(conf);
f.setMultiTableBatchWriter(ConfigUtils.createMultitableBatchWriter(conf));
f.init();
ValueFactory vf = new ValueFactoryImpl();
URI subject1 = new URIImpl("foo:subj");
URI predicate1 = RDFS.LABEL;
Value object1 = vf.createLiteral("this is a new hat");
URI context1 = new URIImpl("foo:context");
Statement statement1 = vf.createStatement(subject1, predicate1, object1, context1);
f.storeStatement(RdfToRyaConversions.convertStatement(statement1));
URI subject2 = new URIImpl("foo:subject");
URI predicate2 = RDFS.LABEL;
Value object2 = vf.createLiteral("Do you like my new hat?");
URI context2 = new URIImpl("foo:context");
Statement statement2 = vf.createStatement(subject2, predicate2, object2, context2);
f.storeStatement(RdfToRyaConversions.convertStatement(statement2));
f.flush();
System.out.println("testDelete: BEFORE DELETE");
printTables(conf);
f.deleteStatement(RdfToRyaConversions.convertStatement(statement1));
System.out.println("testDelete: AFTER FIRST DELETION");
printTables(conf);
Assert.assertEquals(Sets.newHashSet(), getSet(f.queryText("this is a new hat", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(statement2), getSet(f.queryText("Do you like my new hat?", EMPTY_CONSTRAINTS)));
// Check that "new" didn't get deleted from the term table after "this is a new hat"
// was deleted since "new" is still in "Do you like my new hat?"
Assert.assertEquals(Sets.newHashSet(statement2), getSet(f.queryText("new", EMPTY_CONSTRAINTS)));
f.deleteStatement(RdfToRyaConversions.convertStatement(statement2));
System.out.println("testDelete: AFTER LAST DELETION");
printTables(conf);
System.out.println("testDelete: DONE");
Assert.assertEquals(Sets.newHashSet(), getSet(f.queryText("this is a new hat", EMPTY_CONSTRAINTS)));
Assert.assertEquals(Sets.newHashSet(), getSet(f.queryText("Do you like my new hat?", EMPTY_CONSTRAINTS)));
}
}