本文整理汇总了Java中org.apache.clerezza.rdf.ontologies.DC类的典型用法代码示例。如果您正苦于以下问题:Java DC类的具体用法?Java DC怎么用?Java DC使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
DC类属于org.apache.clerezza.rdf.ontologies包,在下文中一共展示了DC类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: ContentStoreImpl
import org.apache.clerezza.rdf.ontologies.DC; //导入依赖的package包/类
public ContentStoreImpl() {
final List<IRI> subjectLabelPath = new ArrayList<IRI>();
subjectLabelPath.add(DC.subject);
subjectLabelPath.add(RDFS.label);
subjectLabel = new PathVirtualProperty(subjectLabelPath, false);
List<VirtualProperty> joinedProperties = new ArrayList<VirtualProperty>();
joinedProperties.add(contentProperty);
joinedProperties.add(subjectLabel);
labelsAndContent = new JoinVirtualProperty(joinedProperties,false);
}
示例2: activate
import org.apache.clerezza.rdf.ontologies.DC; //导入依赖的package包/类
@Activate
protected void activate(ComponentContext context) {
log.info("Enhanced Content Store being activated");
final List<VirtualProperty> indexProperties = new ArrayList<VirtualProperty>();
//indexProperties.add(contentProperty);
//indexProperties.add(subjectLabel);
indexProperties.add(labelsAndContent);
indexProperties.add(new PropertyHolder(DC.subject, true));
indexProperties.add(new PropertyHolder(RDF.type, true));
indexService.addDefinitionVirtual(ECS.ContentItem, indexProperties);
}
示例3: addRelevantDescription
import org.apache.clerezza.rdf.ontologies.DC; //导入依赖的package包/类
private void addRelevantDescription(GraphNode cgContent, Graph resultGraph, boolean withContent) {
Lock l = cgContent.readLock();
l.lock();
try {
Iterator<Literal> valueIter = cgContent.getLiterals(SIOC.content);
//if (!withContent) {
while (valueIter.hasNext()) {
final Literal valueLit = valueIter.next();
final String textualContent = valueLit.getLexicalForm();
final String preview = textualContent.substring(
0, Math.min(PREVIEW_LENGTH, textualContent.length()))
.replace('\n', ' ')
.replace("\r", "");
Language language = valueLit.getLanguage();
resultGraph.add(new TripleImpl((BlankNodeOrIRI) cgContent.getNode(), ECS.textPreview,
new PlainLiteralImpl(preview, language)));
}
//}
copyProperties(cgContent, resultGraph, DCTERMS.title, DCTERMS.abstract_,
RDFS.comment, DC.description, MEDIA_TITLE);
if (withContent) {
copyProperties(cgContent, resultGraph, SIOC.content);
}
} finally {
l.unlock();
}
}
示例4: addSubjects
import org.apache.clerezza.rdf.ontologies.DC; //导入依赖的package包/类
/**
* Add dc:subject property to items pointing to entities extracted by NLP
* engines in the default chain. Given a node and a TripleCollection
* containing fise:Enhancements about that node dc:subject properties are
* added to an item pointing to entities referenced by those enhancements if
* the enhancement confidence value is above a threshold.
*
* @param node
* @param metadata
*/
private void addSubjects(MGraph targetGraph, UriRef itemRef, TripleCollection metadata) {
final GraphNode enhancementType = new GraphNode(TechnicalClasses.ENHANCER_ENHANCEMENT, metadata);
final Set<UriRef> entities = new HashSet<UriRef>();
// get all the enhancements
final Iterator<GraphNode> enhancements = enhancementType.getSubjectNodes(RDF.type);
while (enhancements.hasNext()) {
final GraphNode enhhancement = enhancements.next();
final Iterator<Literal> confidenceLiterals = enhhancement.getLiterals(org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_CONFIDENCE);
//look the confidence value for each enhancement
double enhancementConfidence = confidenceLiterals.hasNext() ?
LiteralFactory.getInstance().createObject(Double.class,
(TypedLiteral) confidenceLiterals.next()) : 1;
if (enhancementConfidence >= confidenceThreshold) {
// get entities referenced in the enhancement
final Iterator<Resource> referencedEntities = enhhancement.getObjects(org.apache.stanbol.enhancer.servicesapi.rdf.Properties.ENHANCER_ENTITY_REFERENCE);
while (referencedEntities.hasNext()) {
final UriRef entity = (UriRef) referencedEntities.next();
// Add dc:subject to the patent for each referenced entity
targetGraph.add(new TripleImpl(itemRef, DC.subject, entity));
entities.add(entity);
}
}
}
for (UriRef uriRef : entities) {
// We don't get the entity description directly from metadata
// as the context there would include
addResourceDescription(uriRef, targetGraph);
}
}