本文整理汇总了Java中org.cxio.metadata.MetaDataElement类的典型用法代码示例。如果您正苦于以下问题:Java MetaDataElement类的具体用法?Java MetaDataElement怎么用?Java MetaDataElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
MetaDataElement类属于org.cxio.metadata包,在下文中一共展示了MetaDataElement类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getNetworkCXMetadata
import org.cxio.metadata.MetaDataElement; //导入依赖的package包/类
@PermitAll
@GET
@Path("/{networkid}/aspect/{aspectname}/metadata")
@ApiDoc("Return the metadata of the given aspect name.")
public MetaDataElement getNetworkCXMetadata(
@PathParam("networkid") final String networkId,
@PathParam("aspectname") final String aspectName
)
throws Exception {
logger.info("[start: Getting {} metadata from network {}]", aspectName, networkId);
UUID networkUUID = UUID.fromString(networkId);
try (NetworkDAO dao = new NetworkDAO() ) {
if ( dao.isReadable(networkUUID, getLoggedInUserId())) {
MetaDataCollection mdc = dao.getMetaDataCollection(networkUUID);
logger.info("[end: Return CX metadata from network {}]", networkId);
return mdc.getMetaDataElement(aspectName);
}
throw new UnauthorizedOperationException("User doesn't have access to this network.");
}
}
示例2: createCXMataDataTemplateForAspects
import org.cxio.metadata.MetaDataElement; //导入依赖的package包/类
public MetaDataCollection createCXMataDataTemplateForAspects(Collection<String> aspects) throws NdexException {
MetaDataCollection md= new MetaDataCollection();
for (String aspectName : aspects) {
String aspectVersion = NdexSupportedAspects.get(aspectName);
if ( aspectVersion == null)
throw new NdexException ("Aspect " + aspectName + " is not an NDEx supported aspect.");
MetaDataElement metadataElement = new MetaDataElement();
metadataElement .setName(aspectName);
metadataElement .setVersion(aspectVersion);
metadataElement .setConsistencyGroup(consistencyGroupId);
if ( aspectName .equals(NdexNetworkStatus.ASPECT_NAME))
metadataElement.setElementCount(1L);
md.add(metadataElement );
}
return md;
}
示例3: createCXMataDataTemplate
import org.cxio.metadata.MetaDataElement; //导入依赖的package包/类
public MetaDataCollection createCXMataDataTemplate() {
MetaDataCollection md= new MetaDataCollection();
for ( Map.Entry<String, String> e: NdexSupportedAspects.entrySet()) {
MetaDataElement metadataElement = new MetaDataElement();
metadataElement .setName(e.getKey());
metadataElement .setVersion(e.getValue());
metadataElement .setConsistencyGroup(consistencyGroupId);
md.add(metadataElement );
}
md.setElementCount(NdexNetworkStatus.ASPECT_NAME, 1l);
return md;
}
示例4: getMetaDataElementTempleteFromSrc
import org.cxio.metadata.MetaDataElement; //导入依赖的package包/类
private MetaDataElement getMetaDataElementTempleteFromSrc (String aspectName) {
MetaDataElement old = this.srcMetaDataCollection.getMetaDataElement(aspectName);
// if ( old == null)
// throw new NdexException("MetaData " + aspectName + " is missing in network " + this.networkId.toString());
MetaDataElement result = new MetaDataElement();
result.setConsistencyGroup(old !=null? old.getConsistencyGroup() : Long.valueOf(1l));
result.setName(aspectName);
result.setVersion(old!=null? old.getVersion() : "1.0");
// result.setLastUpdate(currentTime);
return result;
}
示例5: getMetaDataCollection_aux
import org.cxio.metadata.MetaDataElement; //导入依赖的package包/类
private MetaDataCollection getMetaDataCollection_aux (boolean setEdgeAndNodeCounts) {
MetaDataCollection md = networkDoc.field(NdexClasses.Network_P_metadata);
if ( md != null) {
if ( setEdgeAndNodeCounts)
return md;
// otherwise remove all the element counts from metadata.
for ( MetaDataElement m : md ) {
m.setElementCount(null);
}
return md;
}
md = CXMetaDataManager.getInstance().createCXMataDataTemplate();
Timestamp lastUpdate = new Timestamp( ((Date)networkDoc.field(NdexClasses.ExternalObj_mTime)).getTime());
if ( setEdgeAndNodeCounts) {
int edgecount = networkDoc.field(NdexClasses.Network_P_edgeCount);
int nodecount = networkDoc.field(NdexClasses.Network_P_nodeCount);
md.setElementCount(NodesElement.ASPECT_NAME, new Long(nodecount));
md.setElementCount(EdgesElement.ASPECT_NAME, new Long(edgecount));
}
//check citation
populateMDElementCnt(md, NdexClasses.Network_E_Citations, CitationElement.ASPECT_NAME);
populateMDElementCnt(md, NdexClasses.Network_E_FunctionTerms, FunctionTermElement.ASPECT_NAME);
populateMDElementCnt(md, NdexClasses.Network_E_Namespace, NamespacesElement.ASPECT_NAME);
populateMDElementCnt(md, NdexClasses.Network_E_ReifiedEdgeTerms, ReifiedEdgeElement.ASPECT_NAME);
populateMDElementCnt(md, NdexClasses.Network_E_Supports, SupportElement.ASPECT_NAME);
populateMDElementCnt(md, BELNamespaceElement.ASPECT_NAME, BELNamespaceElement.ASPECT_NAME);
if ( md.getMetaDataElement(CitationElement.ASPECT_NAME)==null) {
md.remove(NodeCitationLinksElement.ASPECT_NAME);
md.remove(EdgeCitationLinksElement.ASPECT_NAME);
}
if ( md.getMetaDataElement(SupportElement.ASPECT_NAME) == null) {
md.remove(NodeSupportLinksElement.ASPECT_NAME);
md.remove(EdgeSupportLinksElement.ASPECT_NAME);
}
for ( MetaDataElement e : md ) {
e.setLastUpdate(lastUpdate.getTime());
}
return md;
}