本文整理汇总了Python中CPL.p_object方法的典型用法代码示例。如果您正苦于以下问题:Python CPL.p_object方法的具体用法?Python CPL.p_object怎么用?Python CPL.p_object使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CPL
的用法示例。
在下文中一共展示了CPL.p_object方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: print
# 需要导入模块: import CPL [as 别名]
# 或者: from CPL import p_object [as 别名]
bundle_name = 'Bundle'
print ('Create bundle name:' +
bundle_name)
bundle = c.create_bundle(bundle_name)
CPL.p_bundle(bundle, False)
print ('Add bundle prefix:' + prefix + ':' + iri)
bundle.add_prefix(prefix, iri)
entity_name = 'Entity'
entity_type = CPL.ENTITY
print ('Create object name:' + str(entity_name) + ' type:' + str(entity_type) +
' bundle:' + str(bundle.id))
entity = c.create_object(prefix, entity_name, entity_type, bundle)
CPL.p_object(entity)
agent_name = 'Agent'
agent_type = CPL.AGENT
print ('Create object name:' +
str(agent_name) + ' type:' + str(agent_type) + ' bundle:' + str(bundle.id))
agent = c.create_object(prefix, agent_name, agent_type, bundle)
CPL.p_object(agent)
print('Lookup or create object:' + str(entity_name) + ' type:' + str(entity_type) +
' bundle:' + str(bundle.id))
entityt = c.get_object(prefix, entity_name, entity_type, bundle = bundle)
CPL.p_object(entityt)
if entity.id != entity.id:
print "Lookup returned wrong object!"
sys.exit(1)
示例2: print
# 需要导入模块: import CPL [as 别名]
# 或者: from CPL import p_object [as 别名]
c = CPL.cpl_connection()
print "Session information: "
CPL.p_session(c.session)
# Create objects
print
print '----- Create tests -----'
print
obj1_name = "Process A"
obj1_type = 'proc'
print ('Create object name: ' +
obj1_name + ' type: ' + obj1_type + ' container: void')
o1 = c.create_object(originator, obj1_name, obj1_type)
CPL.p_object(o1, True)
CPL.p_object_version(o1.current_version(), True)
obj2_name = "File A"
obj2_type = 'file'
print ('Create object name: ' + obj2_name + ' type: ' + obj2_type +
' container: ')
CPL.p_id(o1.id, with_newline=True)
o2 = c.create_object(originator, obj2_name, obj2_type, o1)
CPL.p_object(o2)
obj3_name = "Process B"
obj3_type = 'proc'
print ('Create object name: ' +
obj3_name + ' type: ' + obj3_type + ' container: ')
CPL.p_id(o1.id, with_newline=True)