knowL: Knowledge Libraries
Loading...
Searching...
No Matches
Constraint.h
1#pragma once
2
3#include "Forward.h"
4
5#include <knowCore/Value.h>
6
7#include <QExplicitlySharedDataPointer>
8
9namespace knowSHACL
10{
16 {
17 friend class details::DefinitionParser;
18 public:
19 enum class Type
20 {
21 Empty,
22 Class, //< has a given class
23 Datatype, //< has a given datatype
24 DefaultValue, //< has a default value
25 Disjoint, //< is disjoint from the current node
26 Equals, //< is equals to the current node
27 HasValue, //< is equal to a value
28 In, //< is one of the value
29 LanguageIn, //< the node is a string with specified language
30 LessThan,
31 LessThanOrEquals,
32 MaxCount,
33 MinCount,
34 MaxLength, //< the maximum length of a string
35 MinLength, //< the maximum length of a string
36 MaxExclusive, //< the maximum exclusive accepted value
37 MinExclusive, //< the minimum exclusive accepted value
38 MaxInclusive, //< the maximum inclusive accepted value
39 MinInclusive, //< the minimum inclusive accepted value
40 NodeKind, //< is a kind of node
41 Node, //< is an other node constraint
42 QualifiedValue,
43 Pattern, //< Is a pattern
44 Property, //< Is a property
45 UniqueLang,
46 // Agrregates
47 And,
48 Or,
49 Not,
50 XOne
51 };
52 public:
53 Constraint();
54 Constraint(const Constraint& _rhs);
55 Constraint& operator=(const Constraint& _rhs);
60 Type type() const;
64 PropertyShape property() const;
68 knowCore::Value value() const;
72 QList<NodeShape> nodes() const;
73 NodeShape node() const;
74 template<typename _T_>
75 cres_qresult<_T_> value() const
76 {
77 return value().value<_T_>();
78 }
79 QRegularExpression pattern() const;
80 std::optional<int> qualifiedMinCount() const;
81 std::optional<int> qualifiedMaxCount() const;
82 bool qualifiedDisjoint() const;
83 private:
84 struct Private;
85 QExplicitlySharedDataPointer<Private> d;
86 };
87} // namespace knowSHACL
Definition Forward.h:14
Definition Value.h:21
cres_qresult< _T_ > value(TypeCheckingMode _conversion=TypeCheckingMode::Safe) const
Definition Value.h:353
Definition Constraint.h:16
knowCore::Value value() const
Definition Constraint.cpp:36
Type type() const
Definition Constraint.cpp:20
QList< NodeShape > nodes() const
Definition Constraint.cpp:38
PropertyShape property() const
Definition Constraint.cpp:22
Definition NodeShape.h:14
Definition PropertyShape.h:14
Definition DefinitionParser_p.h:6
Definition Constraint_p.h:9