envVocabulary.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:smartcontainers 作者: crcresearch 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号