Go to the documentation of this file.00001
00045 #include <QString>
00046 #include "owldescriptioncreator.h"
00047
00048 OWLDescriptionCreator::OWLDescriptionCreator(const QString &model_type, const QString &object_class, const QDateTime& creation_date) : owl_description(OWL_TEMPLATE)
00049 {
00050 replaceFiller("MODEL_TYPE", model_type);
00051 replaceFiller("OBJECT_CLASS", object_class);
00052
00053 QString creation_string = creation_date.toString("yy_MM_dd_hh_mm_ss_zzz");
00054
00055 replaceFiller("DATE_TIME_yy_MM_dd_HH_mm_ss_SSS", creation_string);
00056 }
00057
00058 void OWLDescriptionCreator::replaceFiller(const QString &filler, const QString &content)
00059 {
00060 owl_description.replace("${" + filler + "}", content);
00061 }
00062
00063 QString OWLDescriptionCreator::getOwlDescription() const
00064 {
00065 return owl_description;
00066 }
00067
00068 const QString OWLDescriptionCreator::OWL_TEMPLATE("\
00069 <?xml version=\"1.0\" ?>\n\
00070 \n\
00071 <!DOCTYPE rdf:RDF [\n\
00072 <!ENTITY owl \"http://www.w3.org/2002/07/owl#\" >\n\
00073 <!ENTITY xsd \"http://www.w3.org/2001/XMLSchema#\" >\n\
00074 <!ENTITY knowrob \"http://ias.cs.tum.edu/kb/knowrob.owl#\" >\n\
00075 <!ENTITY roboearth \"http://www.roboearth.org/kb/roboearth.owl#\" >\n\
00076 <!ENTITY rdfs \"http://www.w3.org/2000/01/rdf-schema#\" >\n\
00077 <!ENTITY rdf \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" >\n\
00078 ]>\n\
00079 \n\
00080 \n\
00081 <rdf:RDF xml:base=\"http://www.roboearth.org/kb/roboearth.owl\"\n\
00082 xmlns=\"http://www.roboearth.org/kb/roboearth.owl#\"\n\
00083 xmlns:comp_cop=\"http://ias.cs.tum.edu/kb/comp_cop.owl#\"\n\
00084 xmlns:knowrob=\"http://ias.cs.tum.edu/kb/knowrob.owl#\"\n\
00085 xmlns:owl=\"http://www.w3.org/2002/07/owl#\"\n\
00086 xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\n\
00087 xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\n\
00088 xmlns:roboearth=\"http://www.roboearth.org/kb/roboearth.owl#\"\n\
00089 xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\">\n\
00090 \n\
00091 <owl:Ontology rdf:about=\"http://www.roboearth.org/kb/roboearth.owl#\">\n\
00092 <owl:imports rdf:resource=\"http://ias.cs.tum.edu/kb/knowrob.owl#\"/>\n\
00093 </owl:Ontology>\n\
00094 \n\
00095 <owl:ObjectProperty rdf:about=\"&roboearth;providesModelFor\"/>\n\
00096 <owl:DatatypeProperty rdf:about=\"&roboearth;creationDateTime\"/>\n\
00097 \n\
00098 <owl:Class rdf:about=\"&roboearth;${MODEL_TYPE}\"/>\n\
00099 <owl:Class rdf:about=\"&owl;Class\"/>\n\
00100 \n\
00101 <owl:NamedIndividual rdf:about=\"&roboearth;${MODEL_TYPE}_${DATE_TIME_yy_MM_dd_HH_mm_ss_SSS}\">\n\
00102 <rdf:type rdf:resource=\"&roboearth;${MODEL_TYPE}\"/>\n\
00103 <creationDateTime rdf:datatype=\"&xsd;string\">${DATE_TIME_yy_MM_dd_HH_mm_ss_SSS}</creationDateTime>\n\
00104 <providesModelFor rdf:resource=\"&knowrob;${OBJECT_CLASS}\"/>\n\
00105 </owl:NamedIndividual>\n\
00106 \n\
00107 <owl:NamedIndividual rdf:about=\"&knowrob;${OBJECT_CLASS}\">\n\
00108 <rdf:type rdf:resource=\"&owl;Class\"/>\n\
00109 </owl:NamedIndividual>\n\
00110 \n\
00111 </rdf:RDF>");