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


Java Provenance类代码示例

本文整理汇总了Java中org.ndexbio.model.cx.Provenance的典型用法代码示例。如果您正苦于以下问题:Java Provenance类的具体用法?Java Provenance怎么用?Java Provenance使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


Provenance类属于org.ndexbio.model.cx包,在下文中一共展示了Provenance类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: CXMetaDataManager

import org.ndexbio.model.cx.Provenance; //导入依赖的package包/类
public CXMetaDataManager() { 
	NdexSupportedAspects = new TreeMap<>();
    	  
    NdexSupportedAspects.put(NodesElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(EdgesElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(NetworkAttributesElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(NodeAttributesElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(EdgeAttributesElement.ASPECT_NAME, "1.0");
    	  NdexSupportedAspects.put(CitationElement.ASPECT_NAME, "1.0");
    	  NdexSupportedAspects.put(SupportElement.ASPECT_NAME, "1.0");
    	  NdexSupportedAspects.put(EdgeCitationLinksElement.ASPECT_NAME,"1.0"); 
    	  NdexSupportedAspects.put(EdgeSupportLinksElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(NodeCitationLinksElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(	NodeSupportLinksElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put( FunctionTermElement.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put( NamespacesElement.ASPECT_NAME, "1.0");
    	  NdexSupportedAspects.put(NdexNetworkStatus.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(Provenance.ASPECT_NAME,"1.0");
    	  NdexSupportedAspects.put(ReifiedEdgeElement.ASPECT_NAME,"1.0");	  
    	  NdexSupportedAspects.put(BELNamespaceElement.ASPECT_NAME, "1.0;");
}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:22,代码来源:CXMetaDataManager.java

示例2: createCXReader

import org.ndexbio.model.cx.Provenance; //导入依赖的package包/类
private static CxElementReader2 createCXReader (InputStream in) throws IOException {
		HashSet<AspectFragmentReader> readers = new HashSet<>(20);
		
		  readers.add(EdgesFragmentReader.createInstance());
		  readers.add(EdgeAttributesFragmentReader.createInstance());
		  readers.add(NetworkAttributesFragmentReader.createInstance());
		  readers.add(NodesFragmentReader.createInstance());
		  readers.add(NodeAttributesFragmentReader.createInstance());
		  
		  readers.add(new GeneralAspectFragmentReader<> (NdexNetworkStatus.ASPECT_NAME,
				NdexNetworkStatus.class));
		  readers.add(new GeneralAspectFragmentReader<> (NamespacesElement.ASPECT_NAME,NamespacesElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (FunctionTermElement.ASPECT_NAME,FunctionTermElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (CitationElement.ASPECT_NAME,CitationElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (SupportElement.ASPECT_NAME,SupportElement.class));
//		  readers.add(new GeneralAspectFragmentReader (ReifiedEdgeElement.ASPECT_NAME,ReifiedEdgeElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (EdgeCitationLinksElement.ASPECT_NAME,EdgeCitationLinksElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (EdgeSupportLinksElement.ASPECT_NAME,EdgeSupportLinksElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (NodeCitationLinksElement.ASPECT_NAME,NodeCitationLinksElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (NodeSupportLinksElement.ASPECT_NAME,NodeSupportLinksElement.class));
		  readers.add(new GeneralAspectFragmentReader<> (Provenance.ASPECT_NAME,Provenance.class));
		  return  new CxElementReader2(in, readers,false);
	}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:24,代码来源:CXNetworkLoader.java

示例3: createCXReader

import org.ndexbio.model.cx.Provenance; //导入依赖的package包/类
private CxElementReader createCXReader () throws IOException {
	HashSet<AspectFragmentReader> readers = new HashSet<>(20);
	
	  readers.add(EdgesFragmentReader.createInstance());
	  readers.add(EdgeAttributesFragmentReader.createInstance());
	  readers.add(NetworkAttributesFragmentReader.createInstance());
	  readers.add(NodesFragmentReader.createInstance());
	  readers.add(NodeAttributesFragmentReader.createInstance());
	  
	  readers.add(new GeneralAspectFragmentReader (NdexNetworkStatus.ASPECT_NAME,
			NdexNetworkStatus.class));
	  readers.add(new GeneralAspectFragmentReader (NamespacesElement.ASPECT_NAME,NamespacesElement.class));
	  readers.add(new GeneralAspectFragmentReader (FunctionTermElement.ASPECT_NAME,FunctionTermElement.class));
	  readers.add(new GeneralAspectFragmentReader (CitationElement.ASPECT_NAME,CitationElement.class));
	  readers.add(new GeneralAspectFragmentReader (SupportElement.ASPECT_NAME,SupportElement.class));
	  readers.add(new GeneralAspectFragmentReader (ReifiedEdgeElement.ASPECT_NAME,ReifiedEdgeElement.class));
	  readers.add(new GeneralAspectFragmentReader (EdgeCitationLinksElement.ASPECT_NAME,EdgeCitationLinksElement.class));
	  readers.add(new GeneralAspectFragmentReader (EdgeSupportLinksElement.ASPECT_NAME,EdgeSupportLinksElement.class));
	  readers.add(new GeneralAspectFragmentReader (NodeCitationLinksElement.ASPECT_NAME,NodeCitationLinksElement.class));
	  readers.add(new GeneralAspectFragmentReader (NodeSupportLinksElement.ASPECT_NAME,NodeSupportLinksElement.class));
	  readers.add(new GeneralAspectFragmentReader (Provenance.ASPECT_NAME,Provenance.class));
	  		  
	  return  CxElementReader.createInstance(inputStream, true,
			   readers);
}
 
开发者ID:ndexbio,项目名称:ndex-common,代码行数:26,代码来源:CXNetworkLoader.java

示例4: getNdexCXWriter

import org.ndexbio.model.cx.Provenance; //导入依赖的package包/类
private static CxWriter getNdexCXWriter(OutputStream out, boolean use_default_pretty_printer) throws IOException {
       CxWriter cxwtr = CxWriter.createInstance(out, use_default_pretty_printer);
       
       GeneralAspectFragmentWriter cfw = new GeneralAspectFragmentWriter(CitationElement.ASPECT_NAME);
       
       for (AspectFragmentWriter afw : CxioUtil.getAllAvailableAspectFragmentWriters() ) {
       	cxwtr.addAspectFragmentWriter(afw);
       }
       
       cxwtr.addAspectFragmentWriter(cfw);
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(SupportElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(NodeCitationLinksElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(EdgeCitationLinksElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(EdgeSupportLinksElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(NodeSupportLinksElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(FunctionTermElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(NamespacesElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(ReifiedEdgeElement.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(NdexNetworkStatus.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(Provenance.ASPECT_NAME));
       cxwtr.addAspectFragmentWriter(new GeneralAspectFragmentWriter(BELNamespaceElement.ASPECT_NAME));
       
       return cxwtr;
}
 
开发者ID:ndexbio,项目名称:ndex-common,代码行数:25,代码来源:CXNetworkExporter.java

示例5: writeProvenance

import org.ndexbio.model.cx.Provenance; //导入依赖的package包/类
private int writeProvenance(CxWriter cxwtr) throws NdexException, IOException {
	Provenance provenance = new Provenance();
       
       ObjectMapper mapper = new ObjectMapper();
       // get the provenance string
       String provenanceString = this.networkDoc.field(NdexClasses.Network_P_provenance);
       // deserialize it to create a ProvenanceEntity object
       if (provenanceString != null && provenanceString.length() > 0){
           ProvenanceEntity e = mapper.readValue(provenanceString, ProvenanceEntity.class);
           provenance.setEntity(e);
           writeNdexAspectElementAsAspectFragment(cxwtr, provenance);
           return 1;
       }
       return 0;
}
 
开发者ID:ndexbio,项目名称:ndex-common,代码行数:16,代码来源:CXNetworkExporter.java

示例6: setProvenance_aux

import org.ndexbio.model.cx.Provenance; //导入依赖的package包/类
protected static void setProvenance_aux(final String networkIdStr, final ProvenanceEntity provenance, User user)
		throws Exception {
	try (NetworkDAO daoNew = new NetworkDAO()){
		
		UUID networkId = UUID.fromString(networkIdStr);

		if ( !daoNew.isWriteable(networkId, user.getExternalId())) {
			logger.error("[end: No write permissions for user account {} on network {}]", 
					user.getUserName(), networkId);
	        throw new UnauthorizedOperationException("User doesn't have write permissions for this network.");
		}

		if(daoNew.isReadOnly(networkId)) {
			daoNew.close();
			logger.info("[end: Can't modify readonly network {}]", networkId);
			throw new NdexException ("Can't update readonly network.");
		} 


		if (!daoNew.networkIsValid(networkId))
			throw new InvalidNetworkException();
			
		if ( daoNew.networkIsLocked(networkId,6)) {
			daoNew.close();
			throw new NetworkConcurrentModificationException ();
		}
		
		daoNew.lockNetwork(networkId);
		daoNew.setProvenance(networkId, provenance);
		daoNew.commit();
		
		//Recreate the CX file 					
	//	NetworkSummary fullSummary = daoNew.getNetworkSummaryById(networkId);
	//	MetaDataCollection metadata = daoNew.getMetaDataCollection(networkId);
		CXNetworkFileGenerator g = new CXNetworkFileGenerator(networkId, daoNew, new Provenance(provenance));
		g.reCreateCXFile();
		daoNew.unlockNetwork(networkId);
		
		
		return ; // provenance; //  daoNew.getProvenance(networkUUID);
	} catch (Exception e) {
		//if (null != daoNew) daoNew.rollback();
		logger.error("[end: Updating provenance of network {}. Exception caught:]{}", networkIdStr, e);	
		throw e;
	} finally {
		logger.info("[end: Updated provenance of network {}]", networkIdStr);
	}
}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:49,代码来源:NetworkServiceV2.java

示例7: CXNetworkFileGenerator

import org.ndexbio.model.cx.Provenance; //导入依赖的package包/类
public CXNetworkFileGenerator(UUID networkUUID, NetworkSummary summary, MetaDataCollection metaDataCollection, ProvenanceEntity prov) {
	networkId = networkUUID;
	fullSummary = summary;
	metadata = metaDataCollection;
	provenance = new Provenance(prov);
}
 
开发者ID:ndexbio,项目名称:ndex-rest,代码行数:7,代码来源:CXNetworkFileGenerator.java


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