epistemik-co / staple-api

Staple API - a structured data API
https://epistemik-co.github.io/staple-api/
MIT License
33 stars 4 forks source link

Class may have only inherited properties #55

Closed sklarman closed 4 years ago

sklarman commented 4 years ago

In the following schema, class dbo:Country has only one property inherited from owl:Thing:

@prefix dbo: <http://dbpedia.org/ontology/> .
      @prefix foaf: <http://xmlns.com/foaf/0.1/> .
      @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
      @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
      @prefix owl: <http://www.w3.org/2002/07/owl#> .
      @prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
      @prefix dct: <http://purl.org/dc/terms/> .
      @prefix schema: <http://schema.org/> .

      owl:Thing a rdfs:Class ;
          rdfs:comment "Anything" .

      dbo:Country a rdfs:Class ;
          rdfs:comment "A country" ;
          rdfs:subClassOf owl:Thing .

rdfs:label a rdf:Property, owl:FunctionalProperty ;
    rdfs:comment "Name of the entity" ;
    schema:domainIncludes owl:Thing ;
    schema:rangeIncludes xsd:string .

This is an acceptable structure, yet it leads to schema compilation error:

2020-02-26 08:59:16 [info]:     Schema generated from string
(node:396) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'fields' of unde
fined
    at createClassList (/home/runner/GleefulLimitedSpof/node_modules/staple-api/schema/schema
FromOntology.js:122:49)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:396) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originat
ed either by throwing inside of an async function without a catch block, or by rejecting a pr
omise which was not handled with .catch(). (rejection id: 1)
(node:396) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the
future, promise rejections that are not handled will terminate the Node.js process with a non
-zero exit code.
anvime commented 4 years ago

issue branch merged successfully