JSON-LD上下文中的术语如何将OWL NamedIndividuals压缩为JavaScript对象?

时间:2018-04-24 21:59:39

标签: protege json-ld

从Protege保存了扩展的JSON-LD文件,我想编写一个压缩JSON-LD的上下文,使得NamedIndividuals成为Javascript对象。我的JSON-LD文件为行星提供轨道参数。

我试图将“地球”定义为术语,但它没有取代@id和@type所需的效果。我想要的是一个紧凑的JSON-LD文件,我可以将其解析为一个对象,并使用与mars.inclinationgraph[i].inclination类似的访问参数值。指导和实例将不胜感激。感谢。

这是一部分完整的JSON-LD文件,其中包含我在JSON-LD Playground中开发的上下文:

   {
  "@context": {
    "demo": "http://example.org/demo#",
    "decimal": "http://www.w3.org/2001/XMLSchema#decimal",
    "owl": "http://www.w3.org/2002/07/owl#",
    "label": "http://www.w3.org/2000/01/rdf-schema#label",
    "comment": "http://www.w3.org/2000/01/rdf-schema#comment",
    "eccentricity": {
      "@id": "demo:eccentricity",
      "@type": "decimal"
    },
    "inclination": {
      "@id": "demo:inclination",
      "@type": "decimal"
    },
    "omega": {
      "@id": "demo:omega",
      "@type": "decimal"
    },
    "sma": {
      "@id": "demo:sma",
      "@type": "decimal"
    },
    "raan": {
      "@id": "demo:raan",
      "@type": "decimal"
    },
    "tau": {
      "@id": "demo:tau",
      "@type": "decimal"
    },
    "period": {
      "@id": "demo:period",
      "@type": "decimal"
    },
    "earth": {
      "@id": "demo:Earth",
      "@type": "owl:namedIndividual"
    }
  },
  "@graph": [
    {
      "@id": "demo:Earth",
      "@type": [
        "owl:NamedIndividual",
        "demo:Orbit"
      ],
      "eccentricity": "0.016708",
      "inclination": "7.155",
      "omega": "-11.26064",
      "period": "365.256363",
      "raan": "23.4392811",
      "sma": "1",
      "tau": "114.20783",
      "label": "Earth"
    },
    {
      "@id": "demo:Mars",
      "@type": [
        "owl:NamedIndividual",
        "demo:Orbit"
      ],
      "eccentricity": "0.0934",
      "inclination": "5.65",
      "omega": "49.558",
      "period": "686.971",
      "raan": "317.68143",
      "sma": "1.523679",
      "tau": "286.502",
      "label": "Mars"
    },
    {
      "@id": "demo:Mercury",
      "@type": [
        "owl:NamedIndividual",
        "demo:Orbit"
      ],
      "eccentricity": "0.20563",
      "inclination": "3.38",
      "omega": "48.331",
      "period": "88",
      "raan": "281.01",
      "sma": "0.387098",
      "tau": "29.124",
      "label": "Mercury"
    },
    {
      "@id": "demo:Orbit",
      "@type": "owl:Class"
    }
  ]
}

0 个答案:

没有答案