def build(self):
ds = self.graph
self.context = {"ce":
"https://raw.githubusercontent.com/Vocamp/ComputationalActivity/master/pattern/ComputationalEnvironment.jsonld"}
CE = Namespace("http://dase.cs.wright.edu/ontologies/ComputationalEnvironment#")
CA = Namespace("http://dase.cs.wright.edu/ontologies/ComputationalActivity#")
DOCKER = Namespace("http://w3id.org/daspos/docker#")
info = cpuinfo.get_cpu_info()
# ISSUES: We want if the architecture URI's to be created only once on
# build or initial commit. Otherwise, we want to re-read the URI's
# from the original graph. There are imm
ds.bind("ce", CE)
ceuri = URIRef(str(uuid.uuid4()))
ds.add((ceuri, RDF.type, CE.ComputationalEnvironment))
osUri = URIRef(str(uuid.uuid4()))
ds.add((ceuri, CE.hasOperatingSystem, osUri))
ds.add((osUri, RDFS.label, Literal("linux")))
processorUri = URIRef(str(uuid.uuid4()))
ds.add((ceuri, CE.hasHardware, processorUri))
archUri = URIRef(str(uuid.uuid4()))
ds.add((processorUri, CE.hasArchitecture, archUri))
ds.add((archUri, RDFS.label, Literal("amd64")))
ds.add((processorUri, CE.hasNumberOfCores,
Literal("4", datatype=XSD.nonNegativeInteger)))
# :hasArchitecture
# :hasNumberOfCores
# :hasOperatingSystem
# :hasSize Memory or HD
# :isAvailable
# :VirtualMACAddress
评论列表
文章目录