knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::semweb Namespace Reference

Classes

class  Class
 
class  Property
 
class  Resource
 

Typedefs

using ClassVisitor = std::function< void(Class &)>
 
using ClassTupleVisitor = std::function< void(Class &, Class &)>
 
using ClassPtr = std::shared_ptr< Class >
 
using PropertyVisitor = std::function< void(Property &)>
 
using PropertyTupleVisitor = std::function< void(Property &, Property &)>
 
using PropertyPtr = std::shared_ptr< Property >
 

Enumerations

enum  OntologyLanguage { RDFS , OWL , RDFS , OWL }
 
enum  PropertyFlag {
  DATATYPE_PROPERTY = 1 << 0 , ANNOTATION_PROPERTY = 1 << 1 , OBJECT_PROPERTY = 1 << 2 , TRANSITIVE_PROPERTY = 1 << 3 ,
  REFLEXIVE_PROPERTY = 1 << 4 , SYMMETRIC_PROPERTY = 1 << 5 , DATATYPE_PROPERTY = 1 << 0 , ANNOTATION_PROPERTY = 1 << 1 ,
  OBJECT_PROPERTY = 1 << 2 , TRANSITIVE_PROPERTY = 1 << 3 , REFLEXIVE_PROPERTY = 1 << 4 , SYMMETRIC_PROPERTY = 1 << 5
}
 
enum  TripleFormat {
  RDF_XML , RDFA , TRIG , GRDDL ,
  TURTLE , N_TRIPLES , RDF_XML , RDFA ,
  TRIG , GRDDL , TURTLE , N_TRIPLES
}
 
enum  OntologyLanguage { RDFS , OWL , RDFS , OWL }
 
enum  PropertyFlag {
  DATATYPE_PROPERTY = 1 << 0 , ANNOTATION_PROPERTY = 1 << 1 , OBJECT_PROPERTY = 1 << 2 , TRANSITIVE_PROPERTY = 1 << 3 ,
  REFLEXIVE_PROPERTY = 1 << 4 , SYMMETRIC_PROPERTY = 1 << 5 , DATATYPE_PROPERTY = 1 << 0 , ANNOTATION_PROPERTY = 1 << 1 ,
  OBJECT_PROPERTY = 1 << 2 , TRANSITIVE_PROPERTY = 1 << 3 , REFLEXIVE_PROPERTY = 1 << 4 , SYMMETRIC_PROPERTY = 1 << 5
}
 
enum  TripleFormat {
  RDF_XML , RDFA , TRIG , GRDDL ,
  TURTLE , N_TRIPLES , RDF_XML , RDFA ,
  TRIG , GRDDL , TURTLE , N_TRIPLES
}
 

Functions

OntologyLanguage ontologyLanguageFromString (std::string_view format)
 
std::string_view ontologyLanguageToString (OntologyLanguage format)
 
bool isOntologyLanguageString (std::string_view format)
 
TripleFormat tripleFormatFromString (std::string_view format)
 
std::string_view tripleFormatToString (TripleFormat format)
 
std::string_view tripleFormatMimeType (TripleFormat format)
 
bool isTripleFormatString (std::string_view format)
 

Typedef Documentation

◆ ClassPtr

typedef std::shared_ptr< Class > knowrob::semweb::ClassPtr

Definition at line 97 of file Class.h.

◆ ClassTupleVisitor

typedef std::function< void(Class &, Class &)> knowrob::semweb::ClassTupleVisitor

Definition at line 21 of file Class.h.

◆ ClassVisitor

typedef std::function< void(Class &)> knowrob::semweb::ClassVisitor

Definition at line 19 of file Class.h.

◆ PropertyPtr

typedef std::shared_ptr< Property > knowrob::semweb::PropertyPtr

Definition at line 175 of file Property.h.

◆ PropertyTupleVisitor

typedef std::function< void(Property &, Property &)> knowrob::semweb::PropertyTupleVisitor

Definition at line 35 of file Property.h.

◆ PropertyVisitor

typedef std::function< void(Property &)> knowrob::semweb::PropertyVisitor

Definition at line 33 of file Property.h.

Enumeration Type Documentation

◆ OntologyLanguage [1/2]

Used to indicate the file format when loading triple data.

Enumerator
RDFS 
OWL 
RDFS 
OWL 

Definition at line 15 of file OntologyLanguage.h.

15  {
16  RDFS,
17  OWL
18  };

◆ OntologyLanguage [2/2]

Used to indicate the file format when loading triple data.

Enumerator
RDFS 
OWL 
RDFS 
OWL 

Definition at line 15 of file OntologyLanguage.h.

15  {
16  RDFS,
17  OWL
18  };

◆ PropertyFlag [1/2]

Defines property type and semantics.

Enumerator
DATATYPE_PROPERTY 
ANNOTATION_PROPERTY 
OBJECT_PROPERTY 
TRANSITIVE_PROPERTY 
REFLEXIVE_PROPERTY 
SYMMETRIC_PROPERTY 
DATATYPE_PROPERTY 
ANNOTATION_PROPERTY 
OBJECT_PROPERTY 
TRANSITIVE_PROPERTY 
REFLEXIVE_PROPERTY 
SYMMETRIC_PROPERTY 

Definition at line 20 of file Property.h.

20  {
21  DATATYPE_PROPERTY = 1 << 0,
22  ANNOTATION_PROPERTY = 1 << 1,
23  OBJECT_PROPERTY = 1 << 2,
24  TRANSITIVE_PROPERTY = 1 << 3,
25  REFLEXIVE_PROPERTY = 1 << 4,
26  SYMMETRIC_PROPERTY = 1 << 5
27  };
@ SYMMETRIC_PROPERTY
Definition: Property.h:26
@ TRANSITIVE_PROPERTY
Definition: Property.h:24
@ ANNOTATION_PROPERTY
Definition: Property.h:22
@ REFLEXIVE_PROPERTY
Definition: Property.h:25

◆ PropertyFlag [2/2]

Defines property type and semantics.

Enumerator
DATATYPE_PROPERTY 
ANNOTATION_PROPERTY 
OBJECT_PROPERTY 
TRANSITIVE_PROPERTY 
REFLEXIVE_PROPERTY 
SYMMETRIC_PROPERTY 
DATATYPE_PROPERTY 
ANNOTATION_PROPERTY 
OBJECT_PROPERTY 
TRANSITIVE_PROPERTY 
REFLEXIVE_PROPERTY 
SYMMETRIC_PROPERTY 

Definition at line 20 of file Property.h.

20  {
21  DATATYPE_PROPERTY = 1 << 0,
22  ANNOTATION_PROPERTY = 1 << 1,
23  OBJECT_PROPERTY = 1 << 2,
24  TRANSITIVE_PROPERTY = 1 << 3,
25  REFLEXIVE_PROPERTY = 1 << 4,
26  SYMMETRIC_PROPERTY = 1 << 5
27  };

◆ TripleFormat [1/2]

Used to indicate the file format when loading triple data.

Enumerator
RDF_XML 
RDFA 
TRIG 
GRDDL 
TURTLE 
N_TRIPLES 
RDF_XML 
RDFA 
TRIG 
GRDDL 
TURTLE 
N_TRIPLES 

Definition at line 15 of file TripleFormat.h.

◆ TripleFormat [2/2]

Used to indicate the file format when loading triple data.

Enumerator
RDF_XML 
RDFA 
TRIG 
GRDDL 
TURTLE 
N_TRIPLES 
RDF_XML 
RDFA 
TRIG 
GRDDL 
TURTLE 
N_TRIPLES 

Definition at line 15 of file TripleFormat.h.

15  {
16  RDF_XML,
17  RDFA,
18  TRIG,
19  GRDDL,
20  TURTLE,
21  N_TRIPLES
22  };

Function Documentation

◆ isOntologyLanguageString()

bool knowrob::semweb::isOntologyLanguageString ( std::string_view  format)
Parameters
formatthe string identifier.
Returns
true if the string is a valid ontology language.

Definition at line 17 of file OntologyLanguage.cpp.

17  {
18  auto it = stringToMap.find(format);
19  return (it != stringToMap.end());
20  }

◆ isTripleFormatString()

bool knowrob::semweb::isTripleFormatString ( std::string_view  format)
Parameters
formatthe string representation of the format
Returns
true if the format is a valid triple format

Definition at line 35 of file TripleFormat.cpp.

35  {
36  auto it = stringToMap.find(format);
37  return (it != stringToMap.end());
38  }

◆ ontologyLanguageFromString()

OntologyLanguage knowrob::semweb::ontologyLanguageFromString ( std::string_view  format)
Parameters
formatstring identifier of the data format.
Returns
the corresponding enum value.

Definition at line 22 of file OntologyLanguage.cpp.

22  {
23  auto it = stringToMap.find(format);
24  if (it != stringToMap.end()) {
25  return it->second;
26  }
27  return OntologyLanguage::OWL;
28  }

◆ ontologyLanguageToString()

std::string_view knowrob::semweb::ontologyLanguageToString ( OntologyLanguage  format)
Parameters
formatthe enum value.
Returns
the corresponding string identifier.

Definition at line 30 of file OntologyLanguage.cpp.

30  {
31  switch (format) {
33  return "RDFS";
35  return "OWL";
36  }
37  return "OWL";
38  }

◆ tripleFormatFromString()

TripleFormat knowrob::semweb::tripleFormatFromString ( std::string_view  format)
Parameters
formatthe string representation of the format
Returns
the TripleFormat

Definition at line 40 of file TripleFormat.cpp.

40  {
41  auto it = stringToMap.find(format);
42  if (it != stringToMap.end()) {
43  return it->second;
44  }
45  it = stringToMap2.find(format);
46  if (it != stringToMap2.end()) {
47  return it->second;
48  }
49  return TripleFormat::RDF_XML;
50  }

◆ tripleFormatMimeType()

std::string_view knowrob::semweb::tripleFormatMimeType ( TripleFormat  format)
Parameters
formatthe TripleFormat
Returns
the MIME type of the format

Definition at line 70 of file TripleFormat.cpp.

70  {
71  switch (format) {
72  case semweb::RDF_XML:
73  return "rdfxml";
74  case semweb::TURTLE:
75  return "turtle";
76  case semweb::N_TRIPLES:
77  return "ntriples";
78  case semweb::RDFA:
79  return "rdfa";
80  case semweb::TRIG:
81  return "trig";
82  case semweb::GRDDL:
83  return "grddl";
84  }
85  return "rdfxml";
86  }

◆ tripleFormatToString()

std::string_view knowrob::semweb::tripleFormatToString ( TripleFormat  format)
Parameters
formatthe TripleFormat
Returns
the string representation of the format

Definition at line 52 of file TripleFormat.cpp.

52  {
53  switch (format) {
55  return "RDF/XML";
56  case TripleFormat::RDFA:
57  return "RDFA";
58  case TripleFormat::TRIG:
59  return "TRIG";
61  return "GRDDL";
63  return "TURTLE";
65  return "N-TRIPLES";
66  }
67  return "RDF/XML";
68  }