| 1 | /* This file is part of the FaCT++ DL reasoner |
| 2 | Copyright (C) 2015-2015 Dmitry Tsarkov and The University of Manchester |
| 3 | Copyright (C) 2015-2017 Dmitry Tsarkov |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #ifndef RDF_URIS_H |
| 21 | #define RDF_URIS_H |
| 22 | |
| 23 | #include <string> |
| 24 | |
| 25 | #define RDF_TYPE "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" |
| 26 | |
| 27 | #define RDFS_SUBCLASS_OF "http://www.w3.org/2000/01/rdf-schema#subClassOf" |
| 28 | #define RDFS_SUBPROPERTY_OF "http://www.w3.org/2000/01/rdf-schema#subPropertyOf" |
| 29 | #define RDFS_DOMAIN "http://www.w3.org/2000/01/rdf-schema#domain" |
| 30 | #define RDFS_RANGE "http://www.w3.org/2000/01/rdf-schema#range" |
| 31 | |
| 32 | #define OWL_CLASS "http://www.w3.org/2002/07/owl#Class" |
| 33 | #define OWL_SAME_AS "http://www.w3.org/2002/07/owl#sameAs" |
| 34 | #define OWL_EQUIVALENT_CLASS "http://www.w3.org/2002/07/owl#equivalentClass" |
| 35 | #define OWL_DISJOINT_WITH "http://www.w3.org/2002/07/owl#disjointWith" |
| 36 | #define OWL_THING "http://www.w3.org/2002/07/owl#Thing" |
| 37 | #define OWL_NOTHING "http://www.w3.org/2002/07/owl#Nothing" |
| 38 | |
| 39 | #define OWL_OBJECT_PROPERTY "http://www.w3.org/2002/07/owl#ObjectProperty" |
| 40 | #define OWL_DATATYPE_PROPERTY "http://www.w3.org/2002/07/owl#DatatypeProperty" |
| 41 | #define OWL_TOP_OBJECT_PROPERTY "http://www.w3.org/2002/07/owl#topObjectProperty" |
| 42 | #define OWL_BOTTOM_OBJECT_PROPERTY "http://www.w3.org/2002/07/owl#bottomObjectProperty" |
| 43 | #define OWL_TOP_DATA_PROPERTY "http://www.w3.org/2002/07/owl#topDataProperty" |
| 44 | #define OWL_BOTTOM_DATA_PROPERTY "http://www.w3.org/2002/07/owl#bottomDataProperty" |
| 45 | #define OWL_INVERSE_OF "http://www.w3.org/2002/07/owl#inverseOf" |
| 46 | #define OWL_EQUIVALENT_PROPERTY "http://www.w3.org/2002/07/owl#equivalentProperty" |
| 47 | #define OWL_FUNCTIONAL_PROPERTY "http://www.w3.org/2002/07/owl#FunctionalProperty" |
| 48 | #define OWL_INVERSE_FUNCTIONAL_PROPERTY "http://www.w3.org/2002/07/owl#InverseFunctionalProperty" |
| 49 | #define OWL_SYMMETRIC_PROPERTY "http://www.w3.org/2002/07/owl#SymmetricProperty" |
| 50 | #define OWL_ASYMMETRIC_PROPERTY "http://www.w3.org/2002/07/owl#AsymmetricProperty" |
| 51 | #define OWL_TRANSITIVE_PROPERTY "http://www.w3.org/2002/07/owl#TransitiveProperty" |
| 52 | #define OWL_REFLEXIVE_PROPERTY "http://www.w3.org/2002/07/owl#ReflexiveProperty" |
| 53 | #define OWL_IRREFLEXIVE_PROPERTY "http://www.w3.org/2002/07/owl#IrreflexiveProperty" |
| 54 | |
| 55 | bool isSpecialRole(const std::string& role_name) |
| 56 | { |
| 57 | return (role_name == RDF_TYPE || role_name == OWL_SAME_AS || role_name == OWL_EQUIVALENT_CLASS || role_name == RDFS_SUBCLASS_OF || role_name == RDFS_SUBPROPERTY_OF || role_name == OWL_DISJOINT_WITH || role_name == RDFS_DOMAIN || role_name == RDFS_RANGE || role_name == OWL_EQUIVALENT_PROPERTY || role_name == OWL_INVERSE_OF); |
| 58 | } |
| 59 | |
| 60 | const char* toRdf(const char* name) |
| 61 | { |
| 62 | if (strcmp(name, "TOP") == 0) |
| 63 | return OWL_THING; |
| 64 | else if (strcmp(name, "BOTTOM") == 0) |
| 65 | return OWL_NOTHING; |
| 66 | else if (strcmp(name, "*UROLE*") == 0) |
| 67 | return OWL_TOP_OBJECT_PROPERTY; |
| 68 | else if (strcmp(name, "*EROLE*") == 0) |
| 69 | return OWL_BOTTOM_OBJECT_PROPERTY; |
| 70 | else if (strcmp(name, "*UDROLE*") == 0) |
| 71 | return OWL_TOP_DATA_PROPERTY; |
| 72 | else if (strcmp(name, "*EDROLE*") == 0) |
| 73 | return OWL_BOTTOM_DATA_PROPERTY; |
| 74 | else |
| 75 | return name; |
| 76 | } |
| 77 | |
| 78 | #endif |