当前位置: 首页>>代码示例>>Java>>正文


Java MetaDataElement类代码示例

本文整理汇总了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.");
	}
}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:25,代码来源:NetworkServiceV2.java

示例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;
}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:19,代码来源:CXMetaDataManager.java

示例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;
}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:15,代码来源:CXMetaDataManager.java

示例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;
	}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:13,代码来源:CXNetworkSampleGenerator.java

示例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;
}
 
开发者ID:ndexbio,项目名称:ndex-common,代码行数:48,代码来源:CXNetworkExporter.java


注:本文中的org.cxio.metadata.MetaDataElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。