Patterns for legal compliance checking in a decidable framework of linked open data

This paper presents an approach for legal compliance checking in the Semantic Web which can be effectively applied for applications in the Linked Open Data environment. It is based on modeling deontic norms in terms of ontology classes and ontology property restrictions. It is also shown how this approach can handle norm defeasibility. Such methodology is implemented by decidable fragments of OWL 2, while legal reasoning is carried out by available decidable reasoners. The approach is generalised by presenting patterns for modeling deontic norms and norms compliance checking.


Introduction
Modeling legal rules represents a precondition for developing systems endowed with automatic reasoning facilities for advanced information services in the legal domain. In literature several approaches have been proposed aiming to formalize legal rules to support automatic reasoning, as reasoning on deontic notions (Gabbay et al. 2013), reasoning for norm compliance (Hashmi and Governatori 2018) or for legal argumentation (Prakken and Sartor 2015).
The current successful trend of Semantic Web implementation according to a Linked Open Data (LOD) approach is producing, and is supposed to produce in the next few years, a huge and growing amount of data, semantically qualified, available for sharing and reuse. RDF 1 is the language of the Semantic Web, able to describe a scenario of interest by triples composed by master data (namely entities like concepts or real world objects), metadata (namely properties of such entities) and their values (reference data). Such RDF triples are able to provide a semantic description of a specific domain: for example in the legal one, they can describe concepts, legal rules and facts. In the next future the ability of a legal information system to process Linked Open Data and to show legal reasoning capabilities will be an essential aspect for having an automatic legal assistant in large scale, endowed with AI capabilities. Legal information retrieval, eDiscovery, legal compliance checking, on-line dispute resolution are just few examples of services which can profit from the representation of legal knowledge in the Semantic Web in terms of rules amenable for computation.
In this paper we propose an automatic legal compliance checking framework describing legal rules using Semantic Web standards. This framework has been firstly presented in Francesconi (2019), Francesconi and Governatori (2019), while this work presents more extended examples, as well as a generalisation of the approach in terms of a formal model based on recurrent modeling patterns. The approach guarantees the computational tractability of the problem within the Description Logic framework. As developed for the Semantic Web standards, this approach has its natural application in such a scenario like a LOD environment, however it can also be applied in other environments which can exploit the potential of the Semantic Web standards and related reasoning facilities. This paper is organized as follows: in Sect. 2 a contextual background about Semantic Web languages and their computational complexity are introduced; in Sect. 3 a review of related works about legal reasoning is given, including examples within a description logic computational complexity; in Sect. 4 the distinction between the concepts of Provision and Norm from the legal theory point of view is discussed (Marmor 2014); in Sect. 5 an approach for modeling norms using ontologies, able to implement norm compliance checking within a decidable computational framework is described and tested on examples; in Sect. 6 the ability of the approach to deal with norm defeasibility is presented; in Sect. 7 a generalisation of such an approach is proposed by identifying patterns for modeling deontic norms and norms compliance checking. Finally, in Sect. 8 some conclusions and possible future developments are reported.

Semantic technologies background
For sharing information on the Web in a way that is understandable by both humans and machines, the Semantic Web and LOD principles recommend to use OWL/ RDF(S) 2 standards, able to provide a semantic description of an information scenario of interest. RDF is used for describing instances of such scenario in terms of classes and properties, OWL (including RDF Schema) is the language for representing knowledge models (ontologies) able to give meaning to such classes and properties.
Patterns for legal compliance checking in a decidable framework… OWL can be used at different levels of expressiveness, introducing different levels of computational complexity: OWL-Full is not decidable, namely an algorithm able to guarantee inferences in a finite time does not exist; OWL-DL 3 is a decidable fragment of OWL-Full, namely there are algorithms able to guarantee inferences in a finite time; finally OWL-Lite is a decidable fragment of OWL-DL, with reduced expressiveness. For OWL-DL (hence for OWL-Lite) several reasoners have been developed, like Pellet, 4 Racer, 5 HermiT, 6 able to generate inferences based on a knowledge model. More recently OWL 2 7 has been introduced to extend the expressiveness of OWL, keeping the same three levels of complexity, while introducing three additional decidable languages, optimized in terms of expressiveness and computability, for specific tasks: OWL 2-EL for ontologies with large amount of classes and properties; OWL 2-QL for the purpose of managing large volumes of data; OWL 2-RL for applications that require scalable ways of reasoning without sacrificing the expressive power of the language.
In the Semantic Web, the implementation of decidable profiles of OWL or OWL 2 8 guarantees the computational tractability of specific types of reasoning, in particular reasoning for legal information, like advanced legal information retrieval and norm compliance (Gandon et al. 2017), while it allows us to use already available reasoners.
For representing legal information in the Semantic Web, languages like OWL/ RDF(S) for modeling real world scenarios are usually used, as well as mainly SWRL or RIF for representing legal rules governing such scenarios. Recently, LegalRuleML for modeling legal rules, including defeasible rules representation and defeasible reasoning, has been proposed (Athan et al. 2015;Governatori et al. 2016).
More recently LegalRuleML (OASIS 2017), as specialization of the RuleML standard, has been proposed as language for representing legal rules.
In the last few years several studies have been made to approach the problem of legal reasoning in a decidable computational complexity profile. Van de Ven et al. (2008) proposed HARNESS, a knowledge-based system developed within the ESTRELLA project, able to implement reasoning over norms for legal assessment, basically the evaluation whether a case is allowed or disallowed given an appropriate body of legal norms. HARNESS includes two knowledge bases: a domain ontology and a set of norms representing the normative articles. Both are developed within the OWL 2 DL profile. Assessment consists in classifying individuals and properties making up a case description in terms of both ontology and norms simultaneously. The result tells whether norms are violated or not. Ceci and Gangemi (2016) developed an OWL 2 judicial ontology library (JudO) representing the interpretations performed by a judge when conducting legal reasoning towards the adjudication of a case. On the other hand, Ceci in Ceci (2013) combines the features of description logic-based ontologies with non-monotonic logics such as the defeasible one. Deontic extensions of Defeasible Logic have been proposed (Governatori et al. 2013) and efficient implementations have been developed (Lam and Governatori 2009) and successfully tested on larges scale encodings Witt et al. 2021). To achieve effective reasoning with large dataset, integration with relational databases has been proposed (Islam and Governatori 2018). However, until recent, there was a limited integration with ontologies; to obviate this issue (Bhuiyan et al. 2020) proposed a combination of ontologies and SPARQL queries and a defeasible reasoner for the modeling compliance of autonomous vehicles against traffic rules. Another approach based on non-monotonic reasoning is the PROLEG system proposed by Satoh and coworker created initially to provide a formal model of the Japanese Civil Code (Satoh et al. 2009;Fungwacharakorn et al. 2021). Batsakis et al. (2018) discussed and comparised some pratical implementations for reasoning with legal norms.
A formal framework for reasoning on normative requirements for regulatory compliance is presented by Hashmi et al. (2016). The proposed framework is independent of any existing formalism, and provides a conceptual representation of the semantics of norms needed for business process compliance checking. The framework has been implemented and tested Palmirani and Governatori 2018). On the other hand, recently Gandon et al. (2017) proposed an approach to represent legal rules as Linked Open Data. It aims to respond to the requirements of representing the deontic aspects of normative rules and reasoning on them with Semantic Web languages, as RDFS and OWL for knowledge representation and SPARQL for queries. The rationale of the proposed approach is coupling OWL reasoning with SPARQL rules to formalize and implement legal reasoning (as for example deontic reasoning and compliance checking). In particular normative requirements are represented using LegalRuleML and the deontic conclusions of legal rules are added to each named graph of the concerned state of affairs. Recently, implementation of LegalRuleML have been provided with provisions to integrate with other Semantic Web technologies (Lam and Hashmi 2019;Robaldo 2021). For the particular case of legal compliance checking, van Hee et al. (2010) and Ramezani et al. (2013) showed other approaches based on Petri-Net patterns and alignments. For a survey of regulatory compliance checking in the context of business process see (Hashmi and Governatori 2018).
The main contribution of this paper with respect to the literature is that it presents an approach for legal compliance checking based on the distinction between Provisions and Norms represented by using decidable fragments of OWL 2/RDF(S) for knowledge modeling and rules representation. This allows us to rely on available decidable reasoners, while leaving to SPARQL the sole task to query the dataset of inferred triples in order to verify deontic conclusions or norm compliance. Moreover, the approach is able to cope with defeasible rules.

Provisions and norms
According to the legal theory point of view, the legal order can be seen as a legal discourse composed by linguistic entities or speech acts (Searle 1969) with descriptive or prescriptive functions. Every linguistic entity can be seen in a twofold perspective: as a set of signs organized in words and sentences, as well as the meaning of such signs. Following the same twofold view for the legal domain, we can distinguish two levels of interpretation of a linguistic entity expressing a legal rule: in terms of a set of signs organized in words and sentences for creating a normative statement, typically called Provision (Raz 1980;Biagioli 2009), as well as in terms of the meaning for application of such normative statement, typically called Norm (Guastini 2010;Marmor 2014).
Provisions have been classified in Biagioli (2009) in terms of provision types, organised into two main groups ( Fig. 1): Rules and Rules on Rules. Rules can be Constitutive Rules as Definition introducing entities, or Regulative Rules as the deontic concepts Duty and Right (or in a more deontic oriented terms Obligation and Permission), as well as Power etc., regulating subject roles and activities. Rules on Rules are different kinds of amendments: Temporal, Extension or Content amendments. Each provision type is characterized by specific attributes (for example the Bearer or the Counterpart of a Right/Permission), reflecting the lawmaker directions. Provision types and attributes can be considered as a sort of In this vision, norms represent the way how provisions are applied; as such they represent the product of an interpretative process (Kelsen 1991). Provisions and related norms have, therefore, different roles and properties pertaining to different abstraction levels. Moreover, there may be not a bijective relationship between them: a norm can be expressed by different provisions, as well as it can be valid the opposite, namely one provision can include more norms (Pino 2016). They have also different relationships with time. Provisions, as pure textual objects, are the product of lawmaking (legal drafting activity and promulgation) and are characterized by the in-force date, namely the starting date of their existence in the legal order. On the other hand, norms are the meaning of provisions, namely their applicative interpretation; as such they are characterized by the efficacy date, namely the starting date in which a norm can be concretely applied. For example a taxation rule, in-force at time t 1 (time when the related provision enters the legal order), can express the application of a specific tax starting from time t 2 ( > t 1 ). In this case t 2 is the efficacy date of the norm. Therefore (see Table 1), while it is obvious that we can have cases of provisions in-force and related norms effective, as well as provisions not in-force and related norms not effective, we can also have provisions in-force and related norms not effective, as well as the symmetric case, provisions not in-force and related norms effective (this last one is usually referred as retro-activity (efficacy in the past) or ultra-activity (efficacy in the future) of a norm.
Having different nature, such concepts operate in different domains. A provision, as pure textual object, represents the building block of the legal order (new provisions can enter or leave the legal order itself). On the other hand, a norm can either modify the text of other provisions (in case of different type of amendments) or can introduce restrictions on the real world (in case of obligations, for example).
Advanced legal information retrieval, able to implement reasoning on deontic notions, is a type of reasoning managing textual information, thus pertaining to provisions. A typical example is a system able to implement Hohfeldian reasoning, in which a user submits a query to a legal document collection in order to find the rights/permissions of a bearer A towards a counterpart B: following an Hohfeldian reasoning the system should be able to retrieve back also the provisions expressed as duties/obligations of the bearer B towards the counterpart A,

No No
Patterns for legal compliance checking in a decidable framework… because such obligations can also be seen as A's permissions. An OWL 2 DL approach using the Provision Model for this type of reasoning is illustrated in Francesconi (2014Francesconi ( , 2016. On the other hand, legal compliance checking is a process aiming to verify if a fact, occurring in the real world, complies with existing norms. Real world scenarios and facts can be effectively represented in terms of ontologies and related individuals, respectively. Norms, which facts have to be compliant with, provide constraints on the reality, therefore they can be modeled as restrictions on ontology properties. Such modeling can be used for legal compliance checking. Hereinafter we illustrate an OWL 2 DL approach for modeling norms and how such modeling can be used for the aim of legal compliance checking. Both rules are speech acts, namely Provisions in specific regulations. In this sense R1, 9 can be classified as an Obligation of a Supplier towards a Consumer, while R2 can be classified as an Obligation for any Driver in a specific country. The related modeling, according to the Provision Model approach described in Francesconi (2016), can support advanced legal information retrieval, including Hohfeldian reasoning. On the other hand, when we consider the application of rules like R1 or R2 on specific facts, we actually talk about Norms. As previously discussed, norms can be viewed as constraints on the real world scenario to be regulated.

Norm R1 representation and facts compliance checking
In case of R1, the scenario which R1 applies to, can be modeled in terms of an ontology including a class Supplier, having a boolean property hasCommunicat-edConditions. In OWL 2 terms, the scenario concerning R1 can be expressed as in Fig. 2, where myo: is a fictitious namespace for the ontology "MyOntology".
Norm R1, expressing an obligation, states that suppliers must communicate purchasing conditions to the consumers. In our approach, norm R1 is represented as a restriction on the property hasCommunicatedConditions able to identify the class SupplierR1Compliant of individuals for which the value of the property under consideration is "true", as shown in Fig. 2. The individuals of the class Supplier complying with this norm are all those and only those belonging to the subclass SupplierR1Compliant (Fig. 2). Such a representation for the real world scenario and related norm expressed by R1, results in the OWL 2 DL decidable profile. This modeling allows us to use a OWL 2 DL decidable reasoner 10 in order to implement reasoning facilities as compliance checking with respect to R1. The inferred model produced by the DL reasoner establishes the rdfs:subClassOf relation between SupplierR1Compliant and Supplier (as shown in Fig. 2). Therefore, compliance checking according to the norm R1 is a problem of checking if an individual of type Supplier belongs also to the class SupplierR1Compliant. Patterns for legal compliance checking in a decidable framework… As a concrete example let's consider the two individuals s1 and s2 (Fig. 2) of the class Supplier. s1 is an individual not compliant with R1, while s2 is complaint with R1. The following SPARQL query is able to select the individuals which are complaint with R1 (in our case s2). Legal reasoning in terms of norm compliance checking is therefore performed in a LOD framework, using available reasoners in a decidable computational complexity profile.

Norm R2 representation and facts compliance checking
In case of R2, the vehicle drivers circulation scenario can be modeled in terms of an ontology including a class Driver, having a datatype property hasDrivingSpeed with range in the xsd:float datatype. In OWL 2 terms, the vehicle drivers circulation scenario concerning R2 can be expressed as in Fig. 3.
Norm R2, expressing an obligation, states that, according to a specific country law, one cannot drive over 90 km/h. In our approach norm R2 is represented as a restriction on the property hasDrivingSpeed able to identify the class DriverR2Compliant of individuals for which the values of the property under consideration are in the range [0.0 km/h, 90.0 km/h], as shown in Fig. 3. In order to represent such constraints, the following restriction on the datatype property myo:hasDrivingSpeed to values (inclusively) between 0.0 and 90.0 km/h can be expressed by the xsd:minInclusive and xsd:maxInclusive datatype bound properties. The individuals of the class Driver complying with this norm are all those and only those belonging to the subclass Driv-erR2Compliant (Fig. 3). Also such a representation for the real world scenario and related norm, expressed by R2, results in the OWL 2 DL decidable profile. As in the previous example, the inferred model, produced by the DL reasoner, establishes a rdfs:subClassOf relation between DriverR2Compliant and Driver (as shown in Fig. 3). Therefore, compliance checking according to the norm R2 is a problem of checking if an individual of type Driver belongs also to the class DriverR2Compliant.
As a concrete example, let's consider the four individuals of the class Driver shown in Fig. 3. The individual d4 is not compliant with R2 (having speed 95.0 Km/h ≥ 90.0 Km/h) (Fig. 3). The following query is able to select the individuals which are complaint with R2 (in our case d1, d2 and d3). Also in this case norm compliance checking is performed within a decidable computational complexity profile.

Modeling norms defeasibility for legal compliance checking
Defeasibility is the property of an argumentation system for which a conclusion is open to revision in case evidence to the contrary is provided (Athan et al. 2015). This particularly holds in legal reasoning which is a typical case of non-monotonic reasoning, where norm conflicts or norm exceptions might breach a previous conclusion. In this section, two examples, one dealing with norm conflict and one with norm exception, are modeled within a description logic framework. We also show how such modeling can provide support for defeasible legal reasoning, for example in norm compliance checking. As first example, let's consider rule R2, modeled in Sect. 5, and the following new version of rule R2, introducing a more strict driving speed limit at 80 Km/h:

R2: According to a [country] law, one cannot drive over 80 km/h
The new version of R2 can defeat the previous compliance conclusions, in the sense that individuals, which were compliant with the old version of R2, might not be compliant with it anymore (this is the case in the example in Fig. 4 of the individual d3). In order to cope with this change, the same model (without changing anything on the names of the classes) can be updated just by changing the original restriction on the datatype property hasDrivingSpeed with a new one expressed by the new version of R2, as shown in Fig. 4. Without changing anything on the individuals, their membership to the class DriverR2Compliant changes accordingly so that, for example, the individual d3, compliant with the old version of R2 (Fig. 3), is no more compliant with the new version of R2 (Fig. 4). Therefore, the query able to select compliant individuals remains the same: it retrieves the only individuals compliant with the new version of R2, which are d1 and d2 . ?
{ ? ∶ ∶ } Patterns for legal compliance checking in a decidable framework… As second example, let's consider the following rule R3 11 which establishes the limits for engaging credit activities in a jurisdiction, composed by the following 3 statements ( R3 = R3a ∪ R3b ∪ R3c ): (R3a) It is forbidden to engage in a credit activity without a credit license. (R3b) It is permitted to engage in a credit activity if acting on behalf of a principal and the principal holds a credit activity provided the principal has not been elected to the parliament. (R3c) It is permitted to engage in a credit activity if acting on behalf of a body corporate and the person has been appointed as representative of the body corporate.
The defeasibility of the norm R3 consists in an exception (R3a) which can defeat the previous compliance conclusions about the engagement of an agent in a credit activity, and in the exceptions of exception to it (R3b and R3c) which can defeat the conclusions about the prohibition established by R3a. The whole scenario addressed by norm R3 can be modeled through an ontology (see Fig. 5) describing a class Agent and a specific subclass AgentEngag-ingCreditActivity of the subclass of agents who engage in a credit activity. Also in this case the deontic concepts Prohibition and Permission, expressed in R3a, R3b and R3c, are represented as restrictions on the datatype properties having domain AgentEngagingCreditActivity and expressing the conditions which the norm is subject to. The individuals of the class Agent can engage a credit activity, thus belonging to the subclass AgentEngagingCreditActivity. According to the constraints expressed in R3, individuals can: p1 have a credit license (hasCreditLicense) p2 act on behalf of a principal (isActingOnBehalfOfPrincipal) p3 have principal holding a credit activity (isPrincipalHoldingCreditActivity) p4 have principal elected in Parliament (isPrincipalElectedInParliament) p5 act on behalf of a body corporate (isActingOnBehalfOfBodyCorporate) p6 act as representative of a body corporate (isRepresentativeOfBodyCorporate) Norm R3a states that engaging in a credit activity "is forbidden without a credit license". Therefore, if an individual of the class AgentEngagingCredi-tActivity has a credit license (hasCreditLicence = "true") the activity is permitted. This is modeled as restriction on the property hasCreditLicence so to create a subclass AgentEngagingCreditActivityR3aCompliant of individuals having "true" as value of the property hasCreditLicence. In Fig. 5 the individual ag2 is compliant to the norm R3a.
Norm R3b states that the activity is permitted also when the individual "is acting on behalf of a principal" and "the principal holds a credit activity" and "the principal is not elected in Parliament". This is modeled through a multiple restriction on the properties isActingOnBehalfOfPrincipal = true, isPrincipal-HoldingCreditActivity = true and isPrincipalElectedInParliament = false, so to create a subclass of individuals for which the previous three restrictions contemporarily hold (the result is individuals belonging to the intersection of the subclasses created by the three restrictions). In Fig. 5 the individual ag3 is compliant with norm R3b, because it has the value "true" on both the properties isActin-gOnBehalfOfPrincipal and isPrincipalHoldingCreditActivity and "false" on the property isPrincipalElectedInParliament. Very similar considerations can be made for R3c modeling, concerning restrictions on the properties expressed by the conditions for individuals compliant with R3c.
The individuals compliant with the whole R3, composed by R3a, R3b and R3c, are therefore those belonging to the class AgentEngagingCreditActivityR-3Compliant, obtained as disjoint union of the classes AgentEngagingCreditAc-tivityR3aCompliant, AgentEngagingCreditActivityR3bCompliant, AgentEn-gagingCreditActivityR3cCompliant. In all the other cases, engaging in a credit activity is forbidden. Therefore, the individuals which do not respect the combination of property restrictions, violate norm R3, namely they belong to the class AgentEngagingCreditActivityR3Violating. In Fig. 5 the individual ag1 violates norm R3. The combination of the property restrictions p1, ..., p6 able to identify individuals violating norm R3 can be obtained by the negation of the combination of properties of compliant individuals. In the case of R3, and applying the De Morgan laws, we obtain: In order to verify which individuals are compliant or are violating R3, the following queries on the inferred model are respectively sufficient:

Patterns for deontic norms compliance checking
In this section we aim to generalise the approach presented in the previous sections, for representing deontic norms and implementing an automatic compliance checking procedure within a description logic computational framework.
The examples R1, R2 and R3, discussed in Sects. 5 and 6, represent deontic norms expressed in terms of prohibition, obligation or permission. More in general, given any action description A, prohibition, obligation and permission can be represented by formulas having the following structure: As underlined in Sartor (2006)  Given the previous relations, the following implications hold: (1) It is forbidden to engage in a credit activity without a credit license.
which is equivalent to: It is not permitted to engage in a credit activity without a credit license. and also equivalent to: It is obliged to engage in a credit activity with a credit license.
where the action description A is: to engage in a credit activity without a credit license.
An action description A can be decomposed in terms of a subject category S expressing behavioural or productive actions (Sartor 2006), as well as a set of properties p i , whose negation q i = ¬p i , represent conditions for A.
Therefore we have: For example, being While deontic qualifications "obligatory" and "forbidden" are complete (Sartor 2006), meaning that both the action they are concerned with and the complement of that action is completely determined, this is not the case of a permission. In fact, as pointed out by Sartor in Sartor (2006), if we only know that an action is permitted, we do not know the status of its complement. In particular, when a positive action is permitted (namely, the action is not forbidden: Perm(A) = ¬Forb(A) ), then its omission can be either likewise permitted or forbidden (this will be the case when the action, besides being permitted, also is obligatory) (Sartor 2006). Norm compliance can be deterministically checked when its deontic qualification is complete. For a permission this consists in two cases for an action S : 1. Perm(S(p 1 , p 2 , ...p i )) ∧ Perm(¬S(p 1 , p 2 , ...p i )) : both the action A is permitted and its negation is permitted (in this case we talk about facultativeness) Sartor (2006) 2. Perm(S(p 1 , p 2 , ...p i )) is an exception, subject to conditions p 1 , p 2 , ...p i , of a prohibition The second case, in particular, can be explicitly expressed as a combination of norms, as for the cases R3a) and R3b) of our example in Sect. 6, or can be implicit, as for example a norm giving the possibility to smoke in a restaurant (7) Obl(¬S(q 1 ∧ q 2 ∧ ... ∧ q i )) = Obl(S(p 1 ∧ p 2 ∧ ... ∧ p i )), where p i = ¬q i having a proper ventilation system, whose deontic qualification is complete because it represents an exception, subject to condition, to the more general norm which prohibits to smoke in restaurants.
In case of permissions, therefore, compliance can be checked when the deontic status of the action is complete, therefore it is associated with another norm expressing the permission of the complement of that action, or expressing the prohibition of that action, whose specialisation according to conditions is actually permitted. This means that, in case of permissions, compliance checking of an action has to involve the analysis of the norms which determine its complete deontic status. On the other hand, by analysing just a permission qualification of an action, we can deterministically conclude that, if an individual performs a permitted action, this individual is compliant with that permission, even if we cannot say anything about the compliance or not of the complement of that action.
In our approach checking compliance with a permission means verifying if an individual performs a permitted action, resulting compliant with that permission. The evaluation of the compliance or not compliance of the complement of that action is left to other related norms, if any, contributing to the complete deontic qualification of the permission. This is actually what happens when we want to determine the deontic status of an action by permissions interpretation.
Therefore, given that Perm(A) = ¬Forb(A), a permission can be modeled according to the approach followed for other deontic norms.
Following the notation previously introduced, since A = S(p 1 ∧ p 2 ∧ ... ∧ p n ), for a permission whose deontic qualification is complete, we have: For example considering: R3b = It is permitted to engage in a credit activity if acting on behalf of a principal and the principal holds a credit activity provided the principal has not been elected to the parliament where S = "agent engaging credit activity", p 1 = "is acting on behalf of a principal", p 2 = "is principal holding a credit activity", p 3 = "is principal not elected in parliament", q 1 = "is not acting on behalf of a principal", q 2 = "is principal not holding a credit activity", and q 3 = "is principal elected in parliament".
Such restrictions create a subclass [S]RCompliant of all the individuals of the class S which are compliant with R, for which: Similarly, the detection of the violation of norm R, whose deontic qualification is complete, results in the identification of the individuals which do not respect the combination of property restrictions of R. Such individuals belongs to the class [S] RViolating of the individuals for which the combination of properties p i of compliant individuals are negated.
Note that the approach aims to test compliance of state of affairs (namely individuals of the real world scenario and facts) with respect to the norms, not to provide a framework for fully fledged reasoning about norms (namely deriving automatic conclusions giving premises).

Conclusions and future developments
In this paper we have presented an approach for legal compliance checking within the Semantic Web, to be effectively applied in a Linked Open Data framework. It is based on the representation of deontic norms, as distinct from the related provisions, in terms of domain ontology and ontology properties restrictions. The approach is implemented by decidable fragments of OWL 2, able to guarantee computational tractability and the possibility of using available reasoners. We have also shown how this approach can handle norm defeasibility. Future developments of this work can use more complex modalities to express constraints for specific properties, as using SHACL. 12 Moreover, this approach can be used as a reference model for automatic procedures aimed to extract norms from legal texts and represent them "as code" with the aim of automatic compliance checking of specific state of affairs.
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http:// creat iveco mmons. org/ licen ses/ by/4. 0/.