6 #include "knowrob/Logger.h"
7 #include "knowrob/semweb/Vocabulary.h"
8 #include "knowrob/semweb/rdf.h"
9 #include "knowrob/semweb/rdfs.h"
10 #include "knowrob/semweb/owl.h"
11 #include "knowrob/semweb/PrefixProbe.h"
12 #include "knowrob/storage/reification.h"
13 #include "knowrob/integration/python/utils.h"
37 p.second->reification()->detach();
56 std::vector<ClassPtr> result;
57 for (
auto it = range_it.first; it != range_it.second; ++it) {
58 result.push_back(it->second);
65 std::vector<std::string_view> result;
66 for (
auto it = range_it.first; it != range_it.second; ++it) {
67 result.push_back(it->first);
75 auto newClass = std::make_shared<Class>(
iri);
84 std::optional<std::string_view> graph) {
120 std::vector<PropertyPtr> result;
121 for (
auto it = range_it.first; it != range_it.second; ++it) {
122 result.push_back(it->second);
129 std::vector<std::string_view> result;
130 for (
auto it = range_it.first; it != range_it.second; ++it) {
131 result.push_back(it->first);
159 auto reification = p->reification();
175 std::optional<std::string_view> graph) {
221 KB_WARN(
"cannot set frequency of unknown resource '{}'",
iri);
237 else return it->second;
261 std::shared_ptr<semweb::Class>
262 Vocabulary::define<semweb::Class>(
const std::string_view &
iri) {
return defineClass(
iri); }
265 std::shared_ptr<semweb::Property>
266 Vocabulary::define<semweb::Property>(
const std::string_view &
iri) {
return defineProperty(
iri); }
277 createType<semweb::Resource>();
278 createType<semweb::Property>();
279 createType<semweb::Class>();
282 class_<Vocabulary, std::shared_ptr<Vocabulary>, boost::noncopyable>
283 (
"Vocabulary", init<>())
static constexpr std::string_view ORIGIN_SYSTEM
std::vector< std::string_view > getDefinedPropertyNamesWithPrefix(const std::string_view &prefix) const
bool isDefinedClass(const std::string_view &iri)
std::map< std::string_view, semweb::PropertyPtr, std::less<> > definedReifications_
std::vector< semweb::PropertyPtr > getDefinedPropertiesWithPrefix(const std::string_view &prefix) const
std::vector< std::string_view > getDefinedClassNamesWithPrefix(const std::string_view &prefix) const
std::map< std::string_view, semweb::ClassPtr, std::less<> > definedClasses_
semweb::ClassPtr getDefinedClass(const std::string_view &iri) const
bool isObjectProperty(const std::string_view &iri)
bool isDatatypeProperty(const std::string_view &iri)
std::map< std::string_view, uint64_t > frequency_
bool isSubClassOf(const std::string_view &subClass, const std::string_view &superClass)
std::vector< semweb::ClassPtr > getDefinedClassesWithPrefix(const std::string_view &prefix) const
void increaseFrequency(const std::string_view &iri)
semweb::PropertyPtr defineProperty_(const std::shared_ptr< semweb::Property > &p)
void addResourceType(const std::string_view &resource_iri, const std::string_view &type_iri)
semweb::PropertyPtr getDefinedProperty(const std::string_view &iri) const
void setPropertyFlag(const std::string_view &iri, semweb::PropertyFlag flag)
bool isDefinedProperty(const std::string_view &iri)
uint64_t frequency(const std::string_view &iri) const
void addSubClassOf(const std::string_view &subClass, const std::string_view &superClass, std::optional< std::string_view > graph)
std::map< std::string_view, semweb::PropertyPtr, std::less<> > definedProperties_
static bool isTaxonomicProperty(const std::string_view &iri)
bool isAnnotationProperty(const std::string_view &iri)
const std::shared_ptr< ImportHierarchy > & importHierarchy() const
void setFrequency(const std::string_view &iri, uint64_t frequency)
void setInverseOf(const std::string_view &a, const std::string_view &b)
void addSubPropertyOf(const std::string_view &subProperty, const std::string_view &superProperty, std::optional< std::string_view > graph)
semweb::PropertyPtr getDefinedReification(const std::string_view &iri) const
bool isDefinedReification(const std::string_view &iri)
semweb::ClassPtr defineClass(const std::string_view &iri)
semweb::PropertyPtr defineProperty(const std::string_view &iri)
const IRIAtomPtr inverseOf
const IRIAtomPtr versionInfo
constexpr std::string_view prefix
void createType< Vocabulary >()
void createType< ImportHierarchy >()
const IRIAtomPtr subPropertyOf
const IRIAtomPtr subClassOf
const IRIAtomPtr ReifiedRelation
std::shared_ptr< Class > ClassPtr
std::shared_ptr< Property > PropertyPtr
bool isSubClassOfIRI(std::string_view iri)
bool isClassIRI(std::string_view iri)
bool isTypeIRI(std::string_view iri)
bool isSymmetricPropertyIRI(std::string_view iri)
bool isDatatypePropertyIRI(std::string_view iri)
bool isSubPropertyOfIRI(std::string_view iri)
IRIAtomPtr iri(std::string_view ns, std::string_view name)
std::shared_ptr< IRIAtom > IRIAtomPtr
bool isPropertyIRI(std::string_view iri)
bool isTransitivePropertyIRI(std::string_view iri)
bool isReflexivePropertyIRI(std::string_view iri)
bool isAnnotationPropertyIRI(std::string_view iri)
bool isObjectPropertyIRI(std::string_view iri)