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 Disjoint, //< is disjoint from the current node
25 Equals, //< is equals to the current node
26 HasValue, //< is equal to a value
27 In, //< is one of the value
28 LanguageIn, //< the node is a string with specified language
29 LessThan,
30 LessThanOrEquals,
31 MaxCount,
32 MinCount,
33 MaxLength, //< the maximum length of a string
34 MinLength, //< the maximum length of a string
35 MaxExclusive, //< the maximum exclusive accepted value
36 MinExclusive, //< the minimum exclusive accepted value
37 MaxInclusive, //< the maximum inclusive accepted value
38 MinInclusive, //< the minimum inclusive accepted value
39 NodeKind, //< is a kind of node
40 Node, //< is an other node constraint
41 QualifiedValue,
42 Pattern, //< Is a pattern
43 Property, //< Is a property
44 UniqueLang,
45 // Agrregates
46 And,
47 Or,
48 Not,
49 XOne
50 };
51 public:
52 Constraint();
53 Constraint(const Constraint& _rhs);
54 Constraint& operator=(const Constraint& _rhs);
59 Type type() const;
63 PropertyShape property() const;
67 knowCore::Value value() const;
71 QList<NodeShape> nodes() const;
72 NodeShape node() const;
73 template<typename _T_>
75 {
76 return value().value<_T_>();
77 }
78 QRegExp pattern() const;
79 std::optional<int> qualifiedMinCount() const;
80 std::optional<int> qualifiedMaxCount() const;
81 bool qualifiedDisjoint() const;
82 private:
83 struct Private;
84 QExplicitlySharedDataPointer<Private> d;
85 };
86}
87
Definition Forward.h:12
Definition ReturnValue.h:29
Definition Value.h:13
ReturnValue< _T_ > value(TypeCheckingMode _conversion=TypeCheckingMode::Safe) const
Definition Value.h:229
Definition Constraint.h:16
knowCore::Value value() const
Definition Constraint.cpp:43
Type type() const
Definition Constraint.cpp:26
QList< NodeShape > nodes() const
Definition Constraint.cpp:48
PropertyShape property() const
Definition Constraint.cpp:31
Definition NodeShape.h:14
Definition PropertyShape.h:14
Definition DefinitionParser_p.h:6
Definition Constraint_p.h:9