Skip to content

Instantly share code, notes, and snippets.

@Richard-Degenne
Created July 12, 2018 12:27
Show Gist options
  • Save Richard-Degenne/604976f9f41c030d86a1af2ef1fb2e8b to your computer and use it in GitHub Desktop.
Save Richard-Degenne/604976f9f41c030d86a1af2ef1fb2e8b to your computer and use it in GitHub Desktop.
StackOverflow answer
@prefix : <http://www.example.org#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://www.example.org> .
<http://www.example.org> rdf:type owl:Ontology .
#################################################################
# Object Properties
#################################################################
### http://www.example.org#has_chocolate
:has_chocolate rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf :has_composition ;
rdfs:domain :ChocolateCake ;
rdfs:range :Chocolate .
### http://www.example.org#has_composition
:has_composition rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf owl:topObjectProperty ;
rdfs:domain :Dish ;
rdfs:range :Ingredient .
### http://www.example.org#has_tomato_sauce
:has_tomato_sauce rdf:type owl:ObjectProperty ;
rdfs:subPropertyOf :has_composition ;
rdfs:domain :Pizza ;
rdfs:range :TomatoSauce .
#################################################################
# Classes
#################################################################
### http://www.example.org#Chocolate
:Chocolate rdf:type owl:Class ;
rdfs:subClassOf :Ingredient .
### http://www.example.org#ChocolateCake
:ChocolateCake rdf:type owl:Class ;
rdfs:subClassOf :Dish .
### http://www.example.org#Dish
:Dish rdf:type owl:Class .
### http://www.example.org#Ingredient
:Ingredient rdf:type owl:Class .
### http://www.example.org#Pizza
:Pizza rdf:type owl:Class ;
rdfs:subClassOf :Dish .
### http://www.example.org#TomatoSauce
:TomatoSauce rdf:type owl:Class ;
rdfs:subClassOf :Ingredient .
#################################################################
# Individuals
#################################################################
### http://www.example.org#a_chocolate
:a_chocolate rdf:type owl:NamedIndividual ,
:Chocolate .
### http://www.example.org#something
:something rdf:type owl:NamedIndividual ;
:has_chocolate :a_chocolate .
### Generated by the OWL API (version 4.2.8.20170104-2310) https://github.com/owlcs/owlapi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment