本文整理汇总了Java中org.trellisldp.vocabulary.SKOS类的典型用法代码示例。如果您正苦于以下问题:Java SKOS类的具体用法?Java SKOS怎么用?Java SKOS使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SKOS类属于org.trellisldp.vocabulary包,在下文中一共展示了SKOS类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testExtraLinks
import org.trellisldp.vocabulary.SKOS; //导入依赖的package包/类
@Test
public void testExtraLinks() {
final String inbox = "http://ldn.example.com/inbox";
final String annService = "http://annotation.example.com/resource";
when(mockResource.getExtraLinkRelations()).thenAnswer(inv -> Stream.of(
new SimpleEntry<>(annService, OA.annotationService.getIRIString()),
new SimpleEntry<>(SKOS.Concept.getIRIString(), "type"),
new SimpleEntry<>(inbox, "inbox")));
when(mockHeaders.getAcceptableMediaTypes()).thenReturn(singletonList(TEXT_TURTLE_TYPE));
final GetHandler getHandler = new GetHandler(mockLdpRequest, mockResourceService,
mockIoService, mockBinaryService, baseUrl);
final Response res = getHandler.getRepresentation(mockResource).build();
assertEquals(OK, res.getStatusInfo());
assertTrue(res.getLinks().stream().anyMatch(hasType(SKOS.Concept)));
assertTrue(res.getLinks().stream().anyMatch(hasLink(rdf.createIRI(inbox), "inbox")));
assertTrue(res.getLinks().stream().anyMatch(hasLink(rdf.createIRI(annService),
OA.annotationService.getIRIString())));
}
示例2: testNotification
import org.trellisldp.vocabulary.SKOS; //导入依赖的package包/类
@Test
public void testNotification() {
final IRI resource = rdf.createIRI(identifier);
final Dataset dataset = rdf.createDataset();
dataset.add(rdf.createQuad(Trellis.PreferUserManaged, resource, LDP.inbox, inbox));
dataset.add(rdf.createQuad(Trellis.PreferAudit, rdf.createBlankNode(), PROV.wasAssociatedWith, agent));
dataset.add(rdf.createQuad(Trellis.PreferServerManaged, resource, type, LDP.RDFSource));
dataset.add(rdf.createQuad(Trellis.PreferUserManaged, resource, type, SKOS.Concept));
dataset.add(rdf.createQuad(Trellis.PreferAudit, rdf.createBlankNode(), type, PROV.Activity));
dataset.add(rdf.createQuad(Trellis.PreferAudit, rdf.createBlankNode(), type, AS.Create));
final Instant time = now();
final Notification event = new Notification(identifier, dataset);
assertFalse(time.isAfter(event.getCreated()));
assertTrue(event.getIdentifier().getIRIString().startsWith("urn:uuid:"));
assertEquals(of(resource), event.getTarget());
assertEquals(of(inbox), event.getInbox());
assertEquals(1L, event.getAgents().size());
assertTrue(event.getAgents().contains(agent));
final Collection<IRI> targetTypes = event.getTargetTypes();
assertEquals(2L, targetTypes.size());
assertTrue(targetTypes.contains(LDP.RDFSource));
assertTrue(targetTypes.contains(SKOS.Concept));
final Collection<IRI> eventTypes = event.getTypes();
assertEquals(2L, eventTypes.size());
assertTrue(eventTypes.contains(AS.Create));
assertTrue(eventTypes.contains(PROV.Activity));
}