Skip to content

Commit

Permalink
Separate realignment shapes into anonymous node shapes
Browse files Browse the repository at this point in the history
This patch also updates a test result from one of the to-be-rearranged
classes.

A follow-on patch will regenerate Make-managed files.

References:
* RDFLib/pySHACL#222
* #596
* https://www.w3.org/TR/shacl/#NodeConstraintComponent

Signed-off-by: Alex Nelson <[email protected]>
  • Loading branch information
ajnelson-nist committed Mar 6, 2024
1 parent afa9c83 commit dc24cb7
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 48 deletions.
112 changes: 64 additions & 48 deletions ontology/uco/observable/observable.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -420,12 +420,6 @@ observable:Application
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "Application"@en ;
rdfs:comment "An application is a particular software program designed for end users."@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Application will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:Application ;
.

Expand Down Expand Up @@ -1210,12 +1204,6 @@ observable:Code
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "Code"@en ;
rdfs:comment "Code is a direct representation (source, byte or binary) of a collection of computer instructions that form software which tell a computer how to work. [based on https://en.wikipedia.org/wiki/Software]"@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Code will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:Code ;
.

Expand Down Expand Up @@ -4005,12 +3993,6 @@ observable:Library
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "Library"@en ;
rdfs:comment "A library is a suite of data and programming code that is used to develop software programs and applications. [based on https://www.techopedia.com/definition/3828/software-library]"@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Library will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:Library ;
.

Expand Down Expand Up @@ -5189,12 +5171,6 @@ observable:OperatingSystem
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "OperatingSystem"@en ;
rdfs:comment "An operating system is the software that manages computer hardware, software resources, and provides common services for computer programs. [based on https://en.wikipedia.org/wiki/Operating_system]"@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:OperatingSystem will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:OperatingSystem ;
.

Expand Down Expand Up @@ -5424,12 +5400,6 @@ observable:Process
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "Process"@en ;
rdfs:comment "A process is an instance of a computer program executed on an operating system."@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Process will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:Process ;
.

Expand Down Expand Up @@ -5525,12 +5495,6 @@ observable:ProcessThread
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "ProcessThread"@en ;
rdfs:comment "A process thread is the smallest sequence of programmed instructions that can be managed independently by a scheduler on a computer, which is typically a part of the operating system. It is a component of a process. Multiple threads can exist within one process, executing concurrently and sharing resources such as memory, while different processes do not share these resources. In particular, the threads of a process share its executable code and the values of its dynamically allocated variables and non-thread-local global variables at any given time. [based on https://en.wikipedia.org/wiki/Thread_(computing)]"@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Process ;
sh:message "In UCO 2.0.0, uco-observable:ProcessThread will be a subclass of uco-observable:Process. In preparation for UCO 2.0.0, the additional type uco-observable:Process should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:ProcessThread ;
.

Expand Down Expand Up @@ -8606,12 +8570,6 @@ observable:WindowsService
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "WindowsService"@en ;
rdfs:comment "A Windows service is a specific Windows service (a computer program that operates in the background of a Windows operating system, similar to the way a UNIX daemon runs on UNIX). [based on https://en.wikipedia.org/wiki/Windows_service]"@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Service ;
sh:message "In UCO 2.0.0, uco-observable:WindowsService will be a subclass of uco-observable:Service. In preparation for UCO 2.0.0, the additional type uco-observable:Service should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:WindowsService ;
.

Expand Down Expand Up @@ -8737,12 +8695,6 @@ observable:WindowsTask
rdfs:subClassOf observable:ObservableObject ;
rdfs:label "WindowsTask"@en ;
rdfs:comment "A Windows task is a process that is scheduled to execute on a Windows operating system by the Windows Task Scheduler. [based on http://msdn.microsoft.com/en-us/library/windows/desktop/aa381311(v=vs.85).aspx]"@en ;
sh:node [
a sh:NodeShape ;
sh:class observable:Task ;
sh:message "In UCO 2.0.0, uco-observable:WindowsTask will be a subclass of uco-observable:Task. In preparation for UCO 2.0.0, the additional type uco-observable:Task should be assigned to this node."@en ;
sh:severity sh:Warning ;
] ;
sh:targetClass observable:WindowsTask ;
.

Expand Down Expand Up @@ -13816,3 +13768,67 @@ observable:xOriginatingIP
rdfs:range observable:ObservableObject ;
.

[]
a sh:NodeShape ;
sh:class observable:Process ;
sh:message "In UCO 2.0.0, uco-observable:ProcessThread will be a subclass of uco-observable:Process. In preparation for UCO 2.0.0, the additional type uco-observable:Process should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:ProcessThread ;
.

[]
a sh:NodeShape ;
sh:class observable:Service ;
sh:message "In UCO 2.0.0, uco-observable:WindowsService will be a subclass of uco-observable:Service. In preparation for UCO 2.0.0, the additional type uco-observable:Service should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:WindowsService ;
.

[]
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Application will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:Application ;
.

[]
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Code will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:Code ;
.

[]
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Library will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:Library ;
.

[]
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:OperatingSystem will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:OperatingSystem ;
.

[]
a sh:NodeShape ;
sh:class observable:Software ;
sh:message "In UCO 2.0.0, uco-observable:Process will be a subclass of uco-observable:Software. In preparation for UCO 2.0.0, the additional type uco-observable:Software should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:Process ;
.

[]
a sh:NodeShape ;
sh:class observable:Task ;
sh:message "In UCO 2.0.0, uco-observable:WindowsTask will be a subclass of uco-observable:Task. In preparation for UCO 2.0.0, the additional type uco-observable:Task should be assigned to this node."@en ;
sh:severity sh:Warning ;
sh:targetClass observable:WindowsTask ;
.

4 changes: 4 additions & 0 deletions tests/examples/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,10 @@ def test_observable_creation_time_PASS() -> None:
"observable_creation_time_PASS_validation.ttl",
True,
expected_focus_node_severities={
(
"http://example.org/kb/windows-thread-da52a01e-41cc-42d5-85be-ca14bfa10fd6",
str(NS_SH.Warning)
),
(
"http://example.org/kb/windows-thread-facet-4967ae35-f00b-49c8-9dd2-38e3bdf851e1",
str(NS_SH.Warning)
Expand Down

0 comments on commit dc24cb7

Please sign in to comment.