Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What alignement with WoT TD vocabulary? #187

Open
FabienGandon opened this issue Nov 24, 2023 · 8 comments
Open

What alignement with WoT TD vocabulary? #187

FabienGandon opened this issue Nov 24, 2023 · 8 comments
Assignees
Labels
alignment Related to the alignment with other vocabularies high priority ontology Related to the ontology itself question Further information is requested
Milestone

Comments

@FabienGandon
Copy link
Contributor

As discussed in another thread, this issue is open and dedicated to the alignment with the Thing Description (TD) Ontology
https://www.w3.org/2019/wot/td

@FabienGandon FabienGandon added question Further information is requested ontology Related to the ontology itself alignment Related to the alignment with other vocabularies labels Nov 24, 2023
@FabienGandon FabienGandon added this to the V3.2.2.1 milestone Nov 24, 2023
@smnmyr
Copy link
Contributor

smnmyr commented Nov 30, 2023

Our Signifiers should be aligned with TD:Affordances :-)

@danaivach
Copy link
Contributor

@danaivach
Copy link
Contributor

Examples of Signifiers should be provided that are "generated" based on Interaction Affordances. The translation process and information loss should be checked.

@danaivach danaivach self-assigned this Dec 1, 2023
@danaivach
Copy link
Contributor

Generic example.

hMAS resource profile of an artifact:

@prefix hmas: <https://purl.org/hmas/> .
@prefix onto: <https://ci.mines-stetienne.fr/kg/ontology#> .
@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
@prefix pto:   <http://www.productontology.org/id/> .
@prefix htv: <http://www.w3.org/2011/http#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix xs: <https://www.w3.org/2001/XMLSchema#> .
@prefix ex: <http://example.org/> .

ex:ur5Profile a hmas:ResourceProfile;
    hmas:isProfileOf ex:ur5;
    hmas:exposesSignifier ex:gripperMovable .

ex:ur5 a hmas:Artifact, pto:Robotic_arm ;
    hmas:isContainedIn ex:manufacturingWksp .

ex:manufacturingWksp a hmas:Workspace .

ex:gripperMovable a hmas:Signifier ;
    hmas:signifies ex:moveGripperShape .

ex:moveGripperShape a sh:NodeShape;
	sh:class hmas:ActionExecution ;
 	sh:property [
		sh:path prov:used ;
        sh:minCount 1;
        sh:maxCount 1 ;
    	sh:hasValue ex:httpForm ;
  	] ;
	sh:property [
		sh:path hmas:hasInput;
    	sh:qualifiedValueShape ex:gripperJointShape ;
    	sh:qualifiedMinCount 1 ;
    	sh:qualifiedMaxCount 1
  	] .

ex:gripperJointShape a sh:NodeShape ;
	sh:class onto:GripperJoint ;
	sh:property [
		sh:path onto:hasGripperValue ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
        sh:datatype xs:integer
    ] .

ex:httpForm a hctl:Form;
    htv:methodName "PUT";
    hctl:hasTarget <https://api.interactions.ics.unisg.ch/leubot1/v1.3.4/gripper> ;
    hctl:forContentType "application/ur5+json".

hMAS resource profile of a TD thing:

@prefix hmas: <https://purl.org/hmas/> .
@prefix onto: <https://ci.mines-stetienne.fr/kg/ontology#> .
@prefix hctl: <https://www.w3.org/2019/wot/hypermedia#> .
@prefix pto:   <http://www.productontology.org/id/> .
@prefix htv: <http://www.w3.org/2011/http#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix xs: <https://www.w3.org/2001/XMLSchema#> .
@prefix ex: <http://example.org/> .
@prefix td: <https://www.w3.org/2019/wot/td#> .
@prefix wotsec: <https://www.w3.org/2019/wot/security#> .
@prefix js: <https://www.w3.org/2019/wot/json-schema#> .

ex:ur5Profile a hmas:ResourceProfile;
   hmas:isProfileOf ex:ur5;
   hmas:exposesSignifier ex:gripperMovable .

ex:ur5 a td:Thing, pto:Robotic_arm ;
   td:title "UR5 Robotic Arm" ;
   td:hasSecurityConfiguration [ a wotsec:NoSecurityScheme ];
   hmas:isContainedIn ex:manufacturingWksp .

ex:manufacturingWksp a hmas:Workspace .

ex:gripperMovable a hmas:Signifier ;
   hmas:signifies ex:moveGripperShape .

ex:moveGripperShape a td:ActionAffordance ;
   td:hasForm ex:httpForm ;
	td:hasInputSchema ex:gripperJointShape .

ex:gripperJointShape a js:ObjectSchema, onto:GripperJointSchema ;
   js:properties [ a js:IntegerSchema, onto:hasGripperValueSchema ;
         js:propertyName "value"
   ] ;
   js:required "value" .

ex:httpForm a hctl:Form;
   htv:methodName "PUT";
   hctl:hasTarget <https://api.interactions.ics.unisg.ch/leubot1/v1.3.4/gripper> ;
   hctl:forContentType "application/ur5+json".

@danaivach
Copy link
Contributor

Example TD thing to Example hMAS artifact and integration to an hMAS resource profile:

ex:ur5 a td:Thing, pto:Robotic_arm ;
   td:title "UR5 Robotic Arm" ;
   td:hasSecurityConfiguration [ a wotsec:NoSecurityScheme ].
ex:ur5Profile a hmas:ResourceProfile;
   hmas:isProfileOf ex:ur5.

ex:ur5 a td:Thing, pto:Robotic_arm ;
   td:title "UR5 Robotic Arm" ;
   td:hasSecurityConfiguration [ a wotsec:NoSecurityScheme ].

@danaivach
Copy link
Contributor

danaivach commented Dec 14, 2023

Example exposure of TD interaction affordance and exposure of hMAS signifier. This is the simplest approach for integrating TD Affordances and hMAS signifiers:

ex:ur5 td:hasInteractionAffordance ex:affordance. 
ex:ur5Profile a hmas:ResourceProfile;
   hmas:exposesSignifier [ a hmas:Signifier ; hmas:signifies ex:affordance ];
   hmas:isProfileOf ex:ur5.

@danaivach
Copy link
Contributor

danaivach commented Dec 15, 2023

Should a TD property affordance that is readable and writable result to two hMAS action execution shapes?
(The same applies for all TD interaction affordances that have forms with more than one operation types) E.g.:

ex:affordance a td:PropertyAffordance, js:IntegerSchema ;
        td:name "example affordance";
	td:hasForm [ a hctl:Form;
    		hctl:hasOperationType td:readProperty, td:writeProperty ;
    		hctl:hasTarget <https://api.interactions.ics.unisg.ch/example> .
       ] .
ex:behaviorShape1 a sh:NodeShape ;
	sh:class hmas:ActionExecution;
	sh:property [
		sh:path prov:used ;
        	sh:minCount 1;
        	sh:maxCount 1 ;
    		sh:hasValue ex:httpForm1 ;
  	]  ;
      sh:property [
		sh:path hmas:hasInput;
    	        sh:minCount 1;
        	sh:maxCount 1 ;
    	        sh:datatype xs:integer 
  	] .

ex:httpForm1 a hctl:Form;
	hctl:hasOperationType td:writeProperty;
	hctl:hasTarget <https://api.interactions.ics.unisg.ch/example> .
ex:behaviorShape2 a sh:NodeShape ;
	sh:class hmas:ActionExecution;
	sh:property [
		sh:path prov:used ;
        	sh:minCount 1;
        	sh:maxCount 1 ;
    		sh:hasValue ex:httpForm2 ;
  	]  ;
      sh:property [
		sh:path hmas:hasOutput;
    	        sh:minCount 1;
        	sh:maxCount 1 ;
    	        sh:datatype xs:integer 
  	] .

ex:httpForm2 a hctl:Form;
	hctl:hasOperationType td:readProperty;
	hctl:hasTarget <https://api.interactions.ics.unisg.ch/example> .

Depending on the scenario, one could use a behavior shape that combine the above alternatives:

ex:alternativeBehaviorShape a sh:NodeShape ;
	sh:class hmas:ActionExecution;
        sh:or (ex:behaviorShape1 ex:behaviorShape2).

@danaivach
Copy link
Contributor

See how the js Data Schemas can be combined or mapped to SHACL Shapes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
alignment Related to the alignment with other vocabularies high priority ontology Related to the ontology itself question Further information is requested
Projects
None yet
Development

No branches or pull requests

6 participants