w3c-lbd-cg / bot

Building Topology Ontology
https://w3id.org/bot
53 stars 15 forks source link

Create JSON-LD context for BOT #85

Open GeorgFerdinandSchneider opened 3 years ago

GeorgFerdinandSchneider commented 3 years ago

From the discussion in https://github.com/w3c-lbd-cg/bot/issues/82 and inputs received at LDAC 2020, it should be valuable to design a JSON LD context for BOT.

maximelefrancois86 commented 3 years ago

Does this work for you ?

{  
   "@context" : {
    "bot" : "https://w3id.org/bot#",
    "Building" : {
      "@id" : "bot:Building"
    },
    "Zone" : {
      "@id" : "bot:Zone"
    },
    "Site" : {
      "@id" : "bot:Site"
    },
    "Storey" : {
      "@id" : "bot:Storey"
    },
    "Space" : {
      "@id" : "bot:Space"
    },
    "containsZone" : {
      "@id" : "bot:containsZone",
      "@type" : "@id"
    },
    "hasBuilding" : {
      "@id" : "bot:hasBuilding",
      "@type" : "@id"
    },
    "isBuildingOf" : {
      "@reverse" : "bot:hasBuilding"
    },
    "hasStorey" : {
      "@id" : "bot:hasStorey",
      "@type" : "@id"
    },
    "isStoreyOf" : {
      "@reverse" : "bot:hasStorey"
    },
    "hasSpace" : {
      "@id" : "bot:hasSpace",
      "@type" : "@id"
    },
    "isSpaceOf" : {
      "@reverse" : "bot:hasSpace"
    },
    "adjacentZone" : {
      "@id" : "bot:adjacentZone",
     "@type" : "@id"
    },
    "intersectsZone" : {
      "@id" : "bot:intersectsZone",
     "@type" : "@id"
    },
    "Element" : {
      "@id" : "bot:Element"
    },
    "hasSubElement" : {
      "@id" : "bot:hasSubElement",
      "@type" : "@id"
    },
    "isSubElementOf" : {
      "@reverse" : "bot:hasSubElement"
    },
    "hasElement" : {
      "@id" : "bot:hasElement",
      "@type" : "@id"
    },
    "isElementOf" : {
      "@reverse" : "bot:hasElement"
    },
    "containsElement" : {
      "@id" : "bot:containsElement",
      "@type" : "@id"
    },
    "isContainedInZone" : {
      "@reverse" : "bot:containsElement"
    },
    "adjacentElement" : {
      "@id" : "bot:adjacentElement",
      "@type" : "@id"
    },
    "isAdjacentToZone" : {
      "@reverse" : "bot:adjacentElement"
    },
    "intersectingElement" : {
      "@id" : "bot:intersectingElement",
      "@type" : "@id"
    },
    "isIntersectingToZone" : {
      "@reverse" : "bot:intersectingElement"
    },
    "intersectingElement" : {
      "@id" : "bot:intersectingElement",
      "@type" : "@id"
    },
    "isIntersectingToZone" : {
      "@reverse" : "bot:intersectingElement"
    },
    "Interface" : {
      "@id" : "bot:Interface"
    },
    "interfaceOf" : {
      "@id" : "bot:interfaceOf",
      "@type" : "@id"
    },
    "hasZeroPoint" : {
      "@id" : "bot:hasZeroPoint",
      "@type" : "@id"
    },
    "hasSimple3DModel" : {
      "@id" : "bot:hasZeroPoint"
    },
    "has3DModel" : {
      "@id" : "bot:hasZeroPoint",
      "@type" : "@id"
    }
  }
}
MadsHolten commented 3 years ago

@maximelefrancois86 It does. But I think we should include examples like this:

{
    "@context": {
        "bot": "https://w3id.org/bot#",
        "schema": "http://schema.org/",
        "Site" : "bot:Site",
        "Place" : "schema:Place",
        "Building" : "bot:Building",
        "name": {
            "@id": "schema:name",
            "@container": "@language"
        },
        "address": "schema:address"
    },
    "@graph": [
        {
            "@id": "http://dtu.com/locations/LyngbyCampus",
            "@type": ["Place", "Site"],
            "name": {
                "da": "DTU Lyngby Campus",
                "en": "DTU Lyngby Campus"
            },
            "address": "Anker Engelunds Vej 1, 2800 Kongens Lyngby",
            "hasBuilding": "http://dtu.com/locations/LyngbyCampus/Building118"
        },
        {
            "@id": "http://dtu.com/locations/LyngbyCampus/Building118",
            "@type": "Building",
            "name": {
                "da": "Bygning 118",
                "en": "Building 118"
            }
        }
    ]
}
MadsHolten commented 3 years ago

Or for those who have their own internal keys that they wish to map to bot:

{
    "@context": {
        "@vocab": "https://w3id.org/bot#",
        "site_building": {
            "@id": "hasBuilding",
            "@type": "@id"
        }
    },
    "@id": "http://dtu.com/locations/LyngbyCampus",
    "@type": "Site",
    "site_building": [
        "http://dtu.com/locations/LyngbyCampus/Building117",
        "http://dtu.com/locations/LyngbyCampus/Building118"
    ]
}
maximelefrancois86 commented 3 years ago

Do you know a way to contact katja? she volunteered to participate to the discussion

maximelefrancois86 commented 3 years ago

Actually we can do both ways. We can expose a "standard" jsonld context that people can reuse using its url,

and in an informal section we can explain that anyone can create it's own jsonld context to try to map his keys.

GeorgFerdinandSchneider commented 3 years ago

Great your pushing this forward!

@maximelefrancois86 I understood Katja can support on BOT docs.

GeorgFerdinandSchneider commented 3 years ago

@opyh: Potentially this could be interesting for you!? How would you need BOT linked to JSON for you Work?

mathib commented 3 years ago

Adding a ref to the application of JSON-LD with:

both prepared by @devonsparks

devonsparks commented 1 year ago

Is the above the "official" bot @context? If so, I'd like to update my notes on bot frames to reflect these @reverse terms.

MadsHolten commented 1 year ago

Hey Devon! It's been a while. Hope you are doing well. I think it makes sense to publish an official context in this repo and perhaps also some SHACL shapes.