deductions-commits Mailing List for Deductions
Brought to you by:
jmvanel
You can subscribe to this list here.
| 2011 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
(3) |
Jun
(1) |
Jul
(4) |
Aug
(7) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(1) |
May
(2) |
Jun
(2) |
Jul
(5) |
Aug
(6) |
Sep
(3) |
Oct
(3) |
Nov
(1) |
Dec
|
| 2013 |
Jan
(2) |
Feb
(26) |
Mar
|
Apr
(7) |
May
(1) |
Jun
(2) |
Jul
|
Aug
|
Sep
(1) |
Oct
(2) |
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
| 2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
(11) |
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(8) |
Jun
(13) |
Jul
(8) |
Aug
|
Sep
|
Oct
(7) |
Nov
|
Dec
(2) |
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
(4) |
Jun
(4) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jm...@us...> - 2017-06-28 12:03:19
|
Revision: 580
http://sourceforge.net/p/deductions/code/580
Author: jmvanel
Date: 2017-06-28 12:03:17 +0000 (Wed, 28 Jun 2017)
Log Message:
-----------
a class of a rdfs:subClassOf of itself ( to trigger view processing ) , in ametys_content-type2owl_embedded.n3 - for ONISEP
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl_embedded.n3
Modified: n3_nojs/ametys_content-type2owl_embedded.n3
===================================================================
--- n3_nojs/ametys_content-type2owl_embedded.n3 2017-06-23 10:51:06 UTC (rev 579)
+++ n3_nojs/ametys_content-type2owl_embedded.n3 2017-06-28 12:03:17 UTC (rev 580)
@@ -119,3 +119,7 @@
?CLASS_URI ametys:subform-type "repeater" .
} .
+{ ?CL a owl:Class .
+} => {
+ ?CL rdfs:subClassOf ?CL .
+} .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-06-23 10:51:07
|
Revision: 579
http://sourceforge.net/p/deductions/code/579
Author: jmvanel
Date: 2017-06-23 10:51:06 +0000 (Fri, 23 Jun 2017)
Log Message:
-----------
ametys_view2owl.n3 : remove useless data in rule base
Modified Paths:
--------------
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-06-21 14:33:12 UTC (rev 578)
+++ n3_nojs/ametys_view2owl.n3 2017-06-23 10:51:06 UTC (rev 579)
@@ -28,14 +28,13 @@
# transform Ametys CMS views into OWL ("direct mapping")
-<> rdfs:comment """
- <cms:metadata-set name="main" type="edition">
- <cms:metadata-ref name="title" />
- <cms:fieldset role="tab">
- <cms:label i18n="false">Carte d'identité</cms:label>
- <cms:fieldset role="fieldset">
- <cms:label i18n="false">Libellés</cms:label>
-""" .
+# data sample
+# <cms:metadata-set name="main" type="edition">
+# <cms:metadata-ref name="title" />
+# <cms:fieldset role="tab">
+# <cms:label i18n="false">Carte d'identité</cms:label>
+# <cms:fieldset role="fieldset">
+# <cms:label i18n="false">Libellés</cms:label>
# ded:classHasProperty a owl:AnnotationProperty .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-06-21 14:33:14
|
Revision: 578
http://sourceforge.net/p/deductions/code/578
Author: jmvanel
Date: 2017-06-21 14:33:12 +0000 (Wed, 21 Jun 2017)
Log Message:
-----------
ametys_view2owl.n3 : properties are now searched in inherited classes
TODO: also use properties of current embedded class before
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.n3
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_content-type2owl.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.n3 2017-06-19 09:18:45 UTC (rev 577)
+++ n3_nojs/ametys_content-type2owl.n3 2017-06-21 14:33:12 UTC (rev 578)
@@ -50,7 +50,7 @@
} <= {
# _:t e:trace ( ">>>> ded:split 1" ?LIST_STRING ) .
(?LIST_STRING ?DELIM) e:stringSplit ?LIST .
-_:t e:trace ( ">>>> ded:split 2" ?LIST ) .
+ # _:t e:trace ( ">>>> ded:split 2" ?LIST ) .
?STRING0 list:in ?LIST .
# _:t e:trace ( ">>>> ded:split 3" ?STRING0 ) .
# TODO: real trim backward rule
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-06-19 09:18:45 UTC (rev 577)
+++ n3_nojs/ametys_view2owl.n3 2017-06-21 14:33:12 UTC (rev 578)
@@ -70,8 +70,14 @@
?FIELDSET2 cms_:metadata-ref ?MREF_BN .
# _:dd e:trace ( "?MREF_BN" ?MREF_BN ).
?MREF_BN ametysprops:name ?MREF.
- (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
- # _:dd e:trace ( "?MREF_URI_REL" ?MREF_URI_REL ).
+ # (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
+ # _:dd e:trace ( "?MREF" ?MREF "?MREF_URI_REL" ?MREF_URI_REL ).
+
+ ?EMBEDDING_CLASS rdfs:subClassOf ?SUPER_CLASS2 .
+ # _:dd e:trace ( "?EMBEDDING_CLASS rdfs:subClassOf ?SUPER_CLASS2" ?EMBEDDING_CLASS rdfs:subClassOf ?SUPER_CLASS2 ).
+
+ ?MREF_URI_REL rdfs:domain ?SUPER_CLASS2 ; ametys:name ?MREF .
+ # _:dd e:trace ( "11111 ?MREF_URI_REL" ?MREF_URI_REL) .
} .
# TODO pasted from above:
@@ -79,8 +85,9 @@
?FIELDSET cms_:metadata-ref ?MREF_BN .
# _:dd e:trace ( "?MREF_BN 2" ?MREF_BN ).
?MREF_BN ametysprops:name ?MREF.
- (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
- # _:dd e:trace ( "?MREF_URI_REL 2" ?MREF_URI_REL ).
+ # (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
+ ?MREF_URI_REL rdfs:domain ?SUPER_CLASS2 ; ametys:name ?MREF .
+ # _:dd e:trace ( "?MREF_URI_REL 2" ?MREF_URI_REL ).
} .
} => {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-06-19 09:18:48
|
Revision: 577
http://sourceforge.net/p/deductions/code/577
Author: jmvanel
Date: 2017-06-19 09:18:45 +0000 (Mon, 19 Jun 2017)
Log Message:
-----------
Remove all e:trace in Ametys stuff
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.n3
n3_nojs/ametys_content-type2owl.q.n3
n3_nojs/ametys_content-type2owl_embedded.n3
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_content-type2owl.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.n3 2017-05-17 14:44:30 UTC (rev 576)
+++ n3_nojs/ametys_content-type2owl.n3 2017-06-19 09:18:45 UTC (rev 577)
@@ -35,7 +35,9 @@
{ ?CLASS_STRING ametys:label2resource ?CLASS .
} <= {
+# _:t e:trace ( ">>>> label2resource 1" ?CLASS ) .
?CLASS log:uri ?CLASS_STRING.
+# _:t e:trace ( ">>>> label2resource 2" ) .
} .
{ ?LIST_STRING ametys:split ?STRINGS
@@ -46,31 +48,17 @@
# split + trim initial spaces
{ (?LIST_STRING ?DELIM) ded:split ?STRINGS
} <= {
+# _:t e:trace ( ">>>> ded:split 1" ?LIST_STRING ) .
(?LIST_STRING ?DELIM) e:stringSplit ?LIST .
-
- # ( ?LIST_STRING prolog:atom ) log:dtlit ?LIST_STRING_ATOM .
- # ( ?DELIM prolog:atom ) log:dtlit ?DELIM_ATOM .
- # ( ?LIST ?DELIM_ATOM ?LIST_STRING_ATOM ) prolog:atomic_list_concat true .
- # ?STRING_ATOM list:in ?LIST .
+_:t e:trace ( ">>>> ded:split 2" ?LIST ) .
?STRING0 list:in ?LIST .
- # ( ?STRINGS0 prolog:atom ) log:dtlit ?STRING_ATOM .
+# _:t e:trace ( ">>>> ded:split 3" ?STRING0 ) .
# TODO: real trim backward rule
- # ( ?STRINGS0 " " "" ) string:replace ?STRINGS .
- ( ?STRINGS0 " " "" ) string:replace ?STRINGS .
+ ( ?STRING0 " " "" ) string:replace ?STRINGS .
} .
-{ # seems bugged !!!! before ("ded:split2 4..."
- (?LIST_STRING ?DELIM) ded:split2_old ?ATOMS_LIST .
-} <= {
- _:dd11 e:trace ("ded:split2" ?LIST_STRING ?DELIM) .
- ( ?LIST_STRING prolog:atom ) log:dtlit ?LIST_STRING_ATOM .
- _:dd11 e:trace ("ded:split2 2 ?LIST_STRING_ATOM" ?LIST_STRING_ATOM ) .
- ( ?DELIM prolog:atom ) log:dtlit ?DELIM_ATOM .
- _:dd11 e:trace ("ded:split2 3 ?DELIM_ATOM" ?DELIM_ATOM) .
- ( ?ATOMS_LIST ?DELIM_ATOM ?LIST_STRING_ATOM ) prolog:atomic_list_concat true .
- _:dd11 e:trace ("ded:split2 4 ?ATOMS_LIST" ?ATOMS_LIST ) .
-} .
+
{ (?STRING ?DELIM) ded:split2 ?LIST .
} <= {
(?STRING ?DELIM) e:stringSplit ?LIST .
@@ -91,10 +79,8 @@
( ?URI "/" ) ded:split2 ?PARTS .
?PARTS list:last ?LAST .
# ?LAST string:contains ".xml" .
- # ( ?LIST "."^^prolog:atom ?LAST ) prolog:atomic_list_concat true .
( ?LAST "." ) e:stringSplit ?LIST .
?LIST rdf:first ?RES_URI . # ?RES_URI0 .
- # ( ?RES_URI prolog:atom ) log:dtlit ?RES_URI0 .
} .
{
@@ -108,7 +94,7 @@
# from 2 strings, output <URI1/URI2> as URI
{ (?URI1 ?URI2) ametys:relativize ?REL.
} <= {
- _:dd e:trace ( "ametys:relativize ?URI1 URI2" ?URI1 ?URI2 ).
+ # _:dd e:trace ( "ametys:relativize ?URI1 URI2" ?URI1 ?URI2 ).
( ?URI1 "/" ?URI2) func:concat ?CONCAT .
?REL log:uri ?CONCAT .
} .
@@ -115,9 +101,9 @@
# from an URI and a string, output <URI/S> as URI
{ (?URI ?S) ametys:relativizeURIstring ?REL.
} <= {
- _:dd e:trace ( "ametys:relativizeURIstring ?URI S" ?URI ?S ).
+ # _:dd e:trace ( "ametys:relativizeURIstring ?URI S" ?URI ?S ).
?URI log:uri ?URIS .
- _:dd e:trace ( "ametys:relativizeURIstring ?URIS" ?URIS ).
+ # _:dd e:trace ( "ametys:relativizeURIstring ?URIS" ?URIS ).
(?URIS ?S) ametys:relativize ?REL.
} .
@@ -125,6 +111,7 @@
} <= {
_:e e:optional { ?DATATYPE ametys:datatypeCorrespondance ?DATATYPE0 }.
_:e e:optional {
+ # _:dd e:trace ( "ametys:makeDatatype" ?DATATYPE0 ).
# else, make URI by concatenation of xsd: prefix and input ?DATATYPE0
xsd: log:uri ?PREFIX .
( ?PREFIX ?DATATYPE0 ) string:concatenation ?CONCAT .
Modified: n3_nojs/ametys_content-type2owl.q.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.q.n3 2017-05-17 14:44:30 UTC (rev 576)
+++ n3_nojs/ametys_content-type2owl.q.n3 2017-06-19 09:18:45 UTC (rev 577)
@@ -48,10 +48,15 @@
?TYPE ametysprops:extends ?LIST_STRING .
?LIST_STRING ametys:split ?SUPERCLASS_STRING0 . # backward chaining rule
# remove "content-type." in each of ?LIST
+# _:t e:trace ( ">>>> Avant replace ?SUPERCLASS_STRING0 ?LIST_STRING" ?LIST_STRING ?SUPERCLASS_STRING0 ) .
( ?SUPERCLASS_STRING0 "content-type." "" ) string:replace ?SUPERCLASS_STRING .
+# _:t e:trace ( ">>>> Après replace ?SUPERCLASS_STRING0" ?SUPERCLASS_STRING0 ?SUPERCLASS_STRING ) .
?SUPERCLASS_STRING ametys:label2resource ?SUPERCLASS .
+# _:t e:trace ( ">>>>create raw Ametys classes with possibly inheritance 2.5" ) .
} .
- _:e e:optional { ?TYPE cms_:category [ rdf:value ?CATEGORY ] . } .
+ _:e e:optional { ?TYPE cms_:category [ rdf:value ?CATEGORY ] .
+# _:t e:trace ( ">>>>create raw Ametys classes with possibly inheritance 3" ) .
+} .
_:e e:optional { ?TYPE ametysprops:abstract ?ABSTRACT . } .
(?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS )
Modified: n3_nojs/ametys_content-type2owl_embedded.n3
===================================================================
--- n3_nojs/ametys_content-type2owl_embedded.n3 2017-05-17 14:44:30 UTC (rev 576)
+++ n3_nojs/ametys_content-type2owl_embedded.n3 2017-06-19 09:18:45 UTC (rev 577)
@@ -57,10 +57,10 @@
# OUTPUT: ?ROOT : root node, ?IDENTIFIER_URI : relative URI concatenating of XML parent nodes' name attribute
(?ELEM ?IDENTIFIER) ametys:get-content-type-root ( ?ROOT ?IDENTIFIER_URI )
} <= {
- _:dd e:trace ( "get-content-type-root ?PROP" ?PROP ).
+ # _:dd e:trace ( "get-content-type-root ?PROP" ?PROP ).
?PARENT ?PROP ?ELEM .
?ELEM ametysprops:name ?NAME .
- _:dd e:trace ( "get-content-type-root ?NAME" ?NAME ).
+ # _:dd e:trace ( "get-content-type-root ?NAME" ?NAME ).
( ?NAME ?IDENTIFIER ) :smart-concatenation ?IDENTIFIERS .
(?PARENT ?IDENTIFIERS) ametys:get-content-type-root ( ?ROOT ?IDENTIFIER_URI ) .
} .
@@ -68,6 +68,7 @@
{ # smart concatenation with "/"
( ?A ?B ) :smart-concatenation ?CONCAT .
} <= {
+ # _:dd e:trace ( "smart-concatenation ?A ?B" ?A ?B ).
_:g e:optional {
?A log:notEqualTo "" .
?B log:notEqualTo "" .
@@ -88,7 +89,7 @@
{ # assign a ametysprops:name to a :content-type , like embedded types have
?CLASS cms_:content-type ?TYPE .
?CLASS ametys:makeRelativeURIString ?IDENTIFIER .
- _:tt e:trace ("ADD NAME ?TYPE ametysprops:name ?IDENTIFIER ." ?TYPE "ametysprops:name" ?IDENTIFIER ) .
+ # _:tt e:trace ("ADD NAME ?TYPE ametysprops:name ?IDENTIFIER ." ?TYPE "ametysprops:name" ?IDENTIFIER ) .
} => {
?TYPE ametysprops:name ?IDENTIFIER .
} .
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-05-17 14:44:30 UTC (rev 576)
+++ n3_nojs/ametys_view2owl.n3 2017-06-19 09:18:45 UTC (rev 577)
@@ -43,20 +43,20 @@
?S cms_:metadata-set ?O .
?O ametysprops:type "edition" .
?O ametysprops:name "main" .
- _:dd e:trace( " ametysprops:name ?O" ?O ).
+ # _:dd e:trace( " ametysprops:name ?O" ?O ).
?O cms_:fieldset ?FIELDSET .
?FIELDSET cms_:label ?LABEL_BN .
?LABEL_BN rdf:value ?LABEL .
- _:dd e:trace ( "tab ?LABEL" ?LABEL ).
+ # _:dd e:trace ( "tab ?LABEL" ?LABEL ).
(?LABEL " " "_") string:replace ?NEW_CLASS .
- _:dd e:trace ( "?NEW_CLASS" ?NEW_CLASS ).
+ # _:dd e:trace ( "?NEW_CLASS" ?NEW_CLASS ).
?CLASS_URI log:uri ?NEW_CLASS .
- _:dd e:trace ( "?CLASS_URI" ?CLASS_URI ).
+ # _:dd e:trace ( "?CLASS_URI" ?CLASS_URI ).
?CLASS cms_:content-type ?TYPE .
(?TYPE "") ametys:get-content-type-root ( ?ROOT ?EMBEDDING_CLASS ) .
- _:dd e:trace ( "?MREF" ?MREF "EMBEDDING_CLASS" ?EMBEDDING_CLASS).
+ # _:dd e:trace ( "?MREF" ?MREF "EMBEDDING_CLASS" ?EMBEDDING_CLASS).
(?EMBEDDING_CLASS ?NEW_CLASS) ametys:relativizeURIstring ?CLASS_URI_REL.
?SUPER_CLASS log:uri "Onglets_spécifiques" .
@@ -68,19 +68,19 @@
?FIELDSET cms_:fieldset ?FIELDSET2 .
?FIELDSET2 cms_:metadata-ref ?MREF_BN .
- _:dd e:trace ( "?MREF_BN" ?MREF_BN ).
+ # _:dd e:trace ( "?MREF_BN" ?MREF_BN ).
?MREF_BN ametysprops:name ?MREF.
(?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
- _:dd e:trace ( "?MREF_URI_REL" ?MREF_URI_REL ).
+ # _:dd e:trace ( "?MREF_URI_REL" ?MREF_URI_REL ).
} .
# TODO pasted from above:
_:ddd e:optional {
?FIELDSET cms_:metadata-ref ?MREF_BN .
- _:dd e:trace ( "?MREF_BN 2" ?MREF_BN ).
+ # _:dd e:trace ( "?MREF_BN 2" ?MREF_BN ).
?MREF_BN ametysprops:name ?MREF.
(?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
- _:dd e:trace ( "?MREF_URI_REL 2" ?MREF_URI_REL ).
+ # _:dd e:trace ( "?MREF_URI_REL 2" ?MREF_URI_REL ).
} .
} => {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-05-17 14:44:32
|
Revision: 576
http://sourceforge.net/p/deductions/code/576
Author: jmvanel
Date: 2017-05-17 14:44:30 +0000 (Wed, 17 May 2017)
Log Message:
-----------
ametys_view2owl.n3 : better label with embedding class for views - for ONISEP
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.n3
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_content-type2owl.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.n3 2017-05-15 17:03:58 UTC (rev 575)
+++ n3_nojs/ametys_content-type2owl.n3 2017-05-17 14:44:30 UTC (rev 576)
@@ -132,6 +132,10 @@
} .
} .
+{ ?AMETYS_NODE ametys:getAmetysLabel ?LABEL } <= {
+ _:e e:optional { ?AMETYS_NODE cms_:label [ rdf:value ?LABEL ] . } .
+} .
+
########### datatype Correspondance
# XML Schema Ametys
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-05-15 17:03:58 UTC (rev 575)
+++ n3_nojs/ametys_view2owl.n3 2017-05-17 14:44:30 UTC (rev 576)
@@ -60,6 +60,10 @@
(?EMBEDDING_CLASS ?NEW_CLASS) ametys:relativizeURIstring ?CLASS_URI_REL.
?SUPER_CLASS log:uri "Onglets_spécifiques" .
+ ?ROOT cms_:content-type ?CT .
+ ?CT ametys:getAmetysLabel ?LABEL_CONTAINER .
+ ( ?LABEL " (" ?LABEL_CONTAINER ")" ) func:concat ?LABEL2 .
+
_:ddd e:optional {
?FIELDSET cms_:fieldset ?FIELDSET2 .
@@ -82,7 +86,7 @@
} => {
?CLASS_URI_REL
a owl:Class ;
- rdfs:label ?LABEL ;
+ rdfs:label ?LABEL2 ;
rdfs:subClassOf ?SUPER_CLASS ;
form:ui-container form:tab .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-05-15 17:03:59
|
Revision: 575
http://sourceforge.net/p/deductions/code/575
Author: jmvanel
Date: 2017-05-15 17:03:58 +0000 (Mon, 15 May 2017)
Log Message:
-----------
Ametys: take into account also the cms: metadata-ref directly child of a cms:fieldset
Note: The current processing takes into account only the cms:fieldset (which contain cms: metadata-ref) in a cms:fieldset,
For issue ONISEPEDD-70
Modified Paths:
--------------
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-05-15 14:12:08 UTC (rev 574)
+++ n3_nojs/ametys_view2owl.n3 2017-05-15 17:03:58 UTC (rev 575)
@@ -70,6 +70,15 @@
_:dd e:trace ( "?MREF_URI_REL" ?MREF_URI_REL ).
} .
+# TODO pasted from above:
+ _:ddd e:optional {
+ ?FIELDSET cms_:metadata-ref ?MREF_BN .
+ _:dd e:trace ( "?MREF_BN 2" ?MREF_BN ).
+ ?MREF_BN ametysprops:name ?MREF.
+ (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
+ _:dd e:trace ( "?MREF_URI_REL 2" ?MREF_URI_REL ).
+ } .
+
} => {
?CLASS_URI_REL
a owl:Class ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-05-15 14:12:09
|
Revision: 574
http://sourceforge.net/p/deductions/code/574
Author: jmvanel
Date: 2017-05-15 14:12:08 +0000 (Mon, 15 May 2017)
Log Message:
-----------
move triples in ametys_view2owl.n3
Modified Paths:
--------------
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-05-11 08:56:38 UTC (rev 573)
+++ n3_nojs/ametys_view2owl.n3 2017-05-15 14:12:08 UTC (rev 574)
@@ -62,11 +62,10 @@
_:ddd e:optional {
?FIELDSET cms_:fieldset ?FIELDSET2 .
- _:dd e:trace ( "?LABEL 2" ?LABEL ).
+
?FIELDSET2 cms_:metadata-ref ?MREF_BN .
_:dd e:trace ( "?MREF_BN" ?MREF_BN ).
?MREF_BN ametysprops:name ?MREF.
- ?MREF_URI log:uri ?MREF .
(?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
_:dd e:trace ( "?MREF_URI_REL" ?MREF_URI_REL ).
} .
@@ -75,13 +74,12 @@
?CLASS_URI_REL
a owl:Class ;
rdfs:label ?LABEL ;
- ded:classHasProperty ?MREF_URI_REL ;
rdfs:subClassOf ?SUPER_CLASS ;
form:ui-container form:tab .
- ?EMBEDDING_CLASS
- rdfs:subClassOf ?CLASS_URI_REL .
+ ?EMBEDDING_CLASS rdfs:subClassOf ?CLASS_URI_REL .
# ?MREF_URI_REL a rdf:Property .
?MREF_URI_REL rdfs:domain ?CLASS_URI_REL .
+ ?CLASS_URI_REL ded:classHasProperty ?MREF_URI_REL .
} .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-05-11 08:56:39
|
Revision: 573
http://sourceforge.net/p/deductions/code/573
Author: jmvanel
Date: 2017-05-11 08:56:38 +0000 (Thu, 11 May 2017)
Log Message:
-----------
WIP: Take into account the cms:metadata-ref directly in a cms: fieldset
Note: The current processing takes into account only the cms:fieldset (which contain cms: metadata-ref) in a cms:fieldset,
For issue ONISEPEDD-70
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.n3
n3_nojs/ametys_content-type2owl_embedded.n3
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_content-type2owl.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.n3 2017-04-05 13:25:56 UTC (rev 572)
+++ n3_nojs/ametys_content-type2owl.n3 2017-05-11 08:56:38 UTC (rev 573)
@@ -43,24 +43,40 @@
(?LIST_STRING "," ) ded:split ?STRINGS
} .
+# split + trim initial spaces
{ (?LIST_STRING ?DELIM) ded:split ?STRINGS
} <= {
- ( ?LIST_STRING prolog:atom ) log:dtlit ?LIST_STRING_ATOM .
- ( ?DELIM prolog:atom ) log:dtlit ?DELIM_ATOM .
- ( ?LIST ?DELIM_ATOM ?LIST_STRING_ATOM ) prolog:atomic_list_concat true .
- ?STRING_ATOM list:in ?LIST .
- ( ?STRINGS0 prolog:atom ) log:dtlit ?STRING_ATOM .
+ (?LIST_STRING ?DELIM) e:stringSplit ?LIST .
+
+ # ( ?LIST_STRING prolog:atom ) log:dtlit ?LIST_STRING_ATOM .
+ # ( ?DELIM prolog:atom ) log:dtlit ?DELIM_ATOM .
+ # ( ?LIST ?DELIM_ATOM ?LIST_STRING_ATOM ) prolog:atomic_list_concat true .
+ # ?STRING_ATOM list:in ?LIST .
+ ?STRING0 list:in ?LIST .
+ # ( ?STRINGS0 prolog:atom ) log:dtlit ?STRING_ATOM .
# TODO: real trim backward rule
+ # ( ?STRINGS0 " " "" ) string:replace ?STRINGS .
( ?STRINGS0 " " "" ) string:replace ?STRINGS .
} .
-{ (?LIST_STRING ?DELIM) ded:split2 ?ATOMS_LIST
+{ # seems bugged !!!! before ("ded:split2 4..."
+ (?LIST_STRING ?DELIM) ded:split2_old ?ATOMS_LIST .
} <= {
+ _:dd11 e:trace ("ded:split2" ?LIST_STRING ?DELIM) .
( ?LIST_STRING prolog:atom ) log:dtlit ?LIST_STRING_ATOM .
+ _:dd11 e:trace ("ded:split2 2 ?LIST_STRING_ATOM" ?LIST_STRING_ATOM ) .
( ?DELIM prolog:atom ) log:dtlit ?DELIM_ATOM .
+ _:dd11 e:trace ("ded:split2 3 ?DELIM_ATOM" ?DELIM_ATOM) .
( ?ATOMS_LIST ?DELIM_ATOM ?LIST_STRING_ATOM ) prolog:atomic_list_concat true .
- } .
+ _:dd11 e:trace ("ded:split2 4 ?ATOMS_LIST" ?ATOMS_LIST ) .
+} .
+{ (?STRING ?DELIM) ded:split2 ?LIST .
+} <= {
+ (?STRING ?DELIM) e:stringSplit ?LIST .
+} .
+
+
# from <.../Structure.xml_2595228808593840918.n3> , get <Structure>
{ ?S ametys:makeRelativeURI ?REL
} <= {
@@ -75,9 +91,10 @@
( ?URI "/" ) ded:split2 ?PARTS .
?PARTS list:last ?LAST .
# ?LAST string:contains ".xml" .
- ( ?LIST "."^^prolog:atom ?LAST ) prolog:atomic_list_concat true .
- ?LIST rdf:first ?RES_URI0 .
- ( ?RES_URI prolog:atom ) log:dtlit ?RES_URI0 .
+ # ( ?LIST "."^^prolog:atom ?LAST ) prolog:atomic_list_concat true .
+ ( ?LAST "." ) e:stringSplit ?LIST .
+ ?LIST rdf:first ?RES_URI . # ?RES_URI0 .
+ # ( ?RES_URI prolog:atom ) log:dtlit ?RES_URI0 .
} .
{
@@ -91,6 +108,7 @@
# from 2 strings, output <URI1/URI2> as URI
{ (?URI1 ?URI2) ametys:relativize ?REL.
} <= {
+ _:dd e:trace ( "ametys:relativize ?URI1 URI2" ?URI1 ?URI2 ).
( ?URI1 "/" ?URI2) func:concat ?CONCAT .
?REL log:uri ?CONCAT .
} .
@@ -97,7 +115,9 @@
# from an URI and a string, output <URI/S> as URI
{ (?URI ?S) ametys:relativizeURIstring ?REL.
} <= {
+ _:dd e:trace ( "ametys:relativizeURIstring ?URI S" ?URI ?S ).
?URI log:uri ?URIS .
+ _:dd e:trace ( "ametys:relativizeURIstring ?URIS" ?URIS ).
(?URIS ?S) ametys:relativize ?REL.
} .
Modified: n3_nojs/ametys_content-type2owl_embedded.n3
===================================================================
--- n3_nojs/ametys_content-type2owl_embedded.n3 2017-04-05 13:25:56 UTC (rev 572)
+++ n3_nojs/ametys_content-type2owl_embedded.n3 2017-05-11 08:56:38 UTC (rev 573)
@@ -52,13 +52,17 @@
} .
-{ # get content-type root and accumulate (relative) URI : recursion
+{ # get content-type root and accumulate (relative) URI : recursion
+ # INPUT: ?ELEM : blank node , ?IDENTIFIER : string
+ # OUTPUT: ?ROOT : root node, ?IDENTIFIER_URI : relative URI concatenating of XML parent nodes' name attribute
(?ELEM ?IDENTIFIER) ametys:get-content-type-root ( ?ROOT ?IDENTIFIER_URI )
} <= {
+ _:dd e:trace ( "get-content-type-root ?PROP" ?PROP ).
?PARENT ?PROP ?ELEM .
- ?ELEM ametysprops:name ?NAME .
- ( ?NAME ?IDENTIFIER ) :smart-concatenation ?IDENTIFIERS .
- (?PARENT ?IDENTIFIERS) ametys:get-content-type-root ( ?ROOT ?IDENTIFIER_URI ) .
+ ?ELEM ametysprops:name ?NAME .
+ _:dd e:trace ( "get-content-type-root ?NAME" ?NAME ).
+ ( ?NAME ?IDENTIFIER ) :smart-concatenation ?IDENTIFIERS .
+ (?PARENT ?IDENTIFIERS) ametys:get-content-type-root ( ?ROOT ?IDENTIFIER_URI ) .
} .
{ # smart concatenation with "/"
@@ -84,7 +88,7 @@
{ # assign a ametysprops:name to a :content-type , like embedded types have
?CLASS cms_:content-type ?TYPE .
?CLASS ametys:makeRelativeURIString ?IDENTIFIER .
- # _:tt e:trace ("ADD NAME ?TYPE ametysprops:name ?IDENTIFIER ." ?TYPE "ametysprops:name" ?IDENTIFIER ) .
+ _:tt e:trace ("ADD NAME ?TYPE ametysprops:name ?IDENTIFIER ." ?TYPE "ametysprops:name" ?IDENTIFIER ) .
} => {
?TYPE ametysprops:name ?IDENTIFIER .
} .
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-04-05 13:25:56 UTC (rev 572)
+++ n3_nojs/ametys_view2owl.n3 2017-05-11 08:56:38 UTC (rev 573)
@@ -25,6 +25,7 @@
@prefix : <http://example.org#> .
@prefix ded: <http://deductions.com#> .
@prefix form: <http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl#> .
+
# transform Ametys CMS views into OWL ("direct mapping")
<> rdfs:comment """
@@ -42,32 +43,34 @@
?S cms_:metadata-set ?O .
?O ametysprops:type "edition" .
?O ametysprops:name "main" .
- _:dd e:trace( "?O" ?O ).
+ _:dd e:trace( " ametysprops:name ?O" ?O ).
?O cms_:fieldset ?FIELDSET .
?FIELDSET cms_:label ?LABEL_BN .
?LABEL_BN rdf:value ?LABEL .
+ _:dd e:trace ( "tab ?LABEL" ?LABEL ).
- _:dd e:trace ( "?LABEL" ?LABEL ).
-
- ?FIELDSET cms_:fieldset ?FIELDSET2 .
- ?FIELDSET2 cms_:metadata-ref ?MREF_BN .
- ?MREF_BN ametysprops:name ?MREF.
- ?MREF_URI log:uri ?MREF .
-
(?LABEL " " "_") string:replace ?NEW_CLASS .
+ _:dd e:trace ( "?NEW_CLASS" ?NEW_CLASS ).
?CLASS_URI log:uri ?NEW_CLASS .
- # _:dd e:trace ( "?NEW_CLASS" ?NEW_CLASS ).
- # _:dd e:trace ( "?CLASS_URI" ?CLASS_URI ).
-
+ _:dd e:trace ( "?CLASS_URI" ?CLASS_URI ).
?CLASS cms_:content-type ?TYPE .
- # _:dd e:trace ( "?TYPE" ?TYPE ).
(?TYPE "") ametys:get-content-type-root ( ?ROOT ?EMBEDDING_CLASS ) .
-
+ _:dd e:trace ( "?MREF" ?MREF "EMBEDDING_CLASS" ?EMBEDDING_CLASS).
(?EMBEDDING_CLASS ?NEW_CLASS) ametys:relativizeURIstring ?CLASS_URI_REL.
- (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
+ ?SUPER_CLASS log:uri "Onglets_spécifiques" .
- ?SUPER_CLASS log:uri "Onglets_spécifiques" .
+ _:ddd e:optional {
+ ?FIELDSET cms_:fieldset ?FIELDSET2 .
+ _:dd e:trace ( "?LABEL 2" ?LABEL ).
+ ?FIELDSET2 cms_:metadata-ref ?MREF_BN .
+ _:dd e:trace ( "?MREF_BN" ?MREF_BN ).
+ ?MREF_BN ametysprops:name ?MREF.
+ ?MREF_URI log:uri ?MREF .
+ (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
+ _:dd e:trace ( "?MREF_URI_REL" ?MREF_URI_REL ).
+ } .
+
} => {
?CLASS_URI_REL
a owl:Class ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-04-05 13:25:59
|
Revision: 572
http://sourceforge.net/p/deductions/code/572
Author: jmvanel
Date: 2017-04-05 13:25:56 +0000 (Wed, 05 Apr 2017)
Log Message:
-----------
tested --query ametys_view2owl.n3 , with ametys_content-type2owl.n3
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.n3
n3_nojs/ametys_content-type2owl.q.n3
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_content-type2owl.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.n3 2017-04-03 10:30:28 UTC (rev 571)
+++ n3_nojs/ametys_content-type2owl.n3 2017-04-05 13:25:56 UTC (rev 572)
@@ -88,13 +88,13 @@
(?RELCLASS ?PROPNAME) ametys:relativizeURIstring ?PROP_URI.
} .
-# from 2 strings, output <URI1/URI2>
+# from 2 strings, output <URI1/URI2> as URI
{ (?URI1 ?URI2) ametys:relativize ?REL.
} <= {
( ?URI1 "/" ?URI2) func:concat ?CONCAT .
?REL log:uri ?CONCAT .
} .
-# from an URI and a string, output <URI/S>
+# from an URI and a string, output <URI/S> as URI
{ (?URI ?S) ametys:relativizeURIstring ?REL.
} <= {
?URI log:uri ?URIS .
@@ -133,6 +133,7 @@
_:d e:findall( ?AT {?AMETYS_PROP ametysprops:type ?AT . ?AT log:equalTo "composite" .} () ).
(?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
} => {
+ #** connect RDF property URI <--> Ametys XML node for cms:metadata
?PROP_URI ametys:property-node ?AMETYS_PROP .
# ?PROP_URI ametys:property-node-parent (?AMETYS_PROP ?CLASS) .
}.
Modified: n3_nojs/ametys_content-type2owl.q.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.q.n3 2017-04-03 10:30:28 UTC (rev 571)
+++ n3_nojs/ametys_content-type2owl.q.n3 2017-04-05 13:25:56 UTC (rev 572)
@@ -130,9 +130,11 @@
# owl:ObjectProperty and range, directly within the cms_:content-type, or any embedding
{
?PROP_URI ametys:property-node ?AMETYS_PROP .
+ # TODO necessarily ?TYPE log:equalsTo ?PROP_URI
?TYPE cms_:metadata ?AMETYS_PROP .
+
?CLASS ?PROP_PARENT ?TYPE .
-
+
?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
( ?CT_STRING0 "content-type." "" ) string:replace ?CT_STRING .
_:d e:optional { ?CT_STRING ametys:label2resource ?CT } .
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-04-03 10:30:28 UTC (rev 571)
+++ n3_nojs/ametys_view2owl.n3 2017-04-05 13:25:56 UTC (rev 572)
@@ -24,7 +24,7 @@
@prefix ametysprops: <http://example.org#> .
@prefix : <http://example.org#> .
@prefix ded: <http://deductions.com#> .
-
+@prefix form: <http://raw.githubusercontent.com/jmvanel/semantic_forms/master/vocabulary/forms.owl.ttl#> .
# transform Ametys CMS views into OWL ("direct mapping")
<> rdfs:comment """
@@ -36,8 +36,9 @@
<cms:label i18n="false">Libellés</cms:label>
""" .
+# ded:classHasProperty a owl:AnnotationProperty .
+
{
- _:dd1 e:trace ( "????????????" ).
?S cms_:metadata-set ?O .
?O ametysprops:type "edition" .
?O ametysprops:name "main" .
@@ -61,18 +62,23 @@
?CLASS cms_:content-type ?TYPE .
# _:dd e:trace ( "?TYPE" ?TYPE ).
- (?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
- _:dd e:trace ( "?RELCLASS" ?RELCLASS ).
+ (?TYPE "") ametys:get-content-type-root ( ?ROOT ?EMBEDDING_CLASS ) .
+ (?EMBEDDING_CLASS ?NEW_CLASS) ametys:relativizeURIstring ?CLASS_URI_REL.
+ (?EMBEDDING_CLASS ?MREF) ametys:relativizeURIstring ?MREF_URI_REL.
+
+ ?SUPER_CLASS log:uri "Onglets_spécifiques" .
} => {
- ?CLASS_URI
+ ?CLASS_URI_REL
a owl:Class ;
rdfs:label ?LABEL ;
- ded:classHasProperty ?MREF_URI ;
- rdfs:subClassOf <Onglets_spécifiques> .
- ?RELCLASS
- rdfs:subClassOf ?CLASS_URI .
+ ded:classHasProperty ?MREF_URI_REL ;
+ rdfs:subClassOf ?SUPER_CLASS ;
+ form:ui-container form:tab .
- ?MREF_URI a rdf:Property .
- ?MREF_URI rdfs:domain ?CLASS_URI .
+ ?EMBEDDING_CLASS
+ rdfs:subClassOf ?CLASS_URI_REL .
+
+ # ?MREF_URI_REL a rdf:Property .
+ ?MREF_URI_REL rdfs:domain ?CLASS_URI_REL .
} .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-04-03 10:30:30
|
Revision: 571
http://sourceforge.net/p/deductions/code/571
Author: jmvanel
Date: 2017-04-03 10:30:28 +0000 (Mon, 03 Apr 2017)
Log Message:
-----------
ametys_view2owl.n3 : Classes for specific tabs are the ancestors of the content-type classes that contain them, and sub-classes of a unique class for "Onglets_specifiques"
Modified Paths:
--------------
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-04-03 09:52:01 UTC (rev 570)
+++ n3_nojs/ametys_view2owl.n3 2017-04-03 10:30:28 UTC (rev 571)
@@ -65,15 +65,13 @@
_:dd e:trace ( "?RELCLASS" ?RELCLASS ).
} => {
- # ?FIELDSET
?CLASS_URI
- a owl:Class .
- ?CLASS_URI
- rdfs:label ?LABEL .
- ?CLASS_URI
- ded:classHasProperty ?MREF_URI .
- ?CLASS_URI
- rdfs:subClassOf ?RELCLASS .
+ a owl:Class ;
+ rdfs:label ?LABEL ;
+ ded:classHasProperty ?MREF_URI ;
+ rdfs:subClassOf <Onglets_spécifiques> .
+ ?RELCLASS
+ rdfs:subClassOf ?CLASS_URI .
?MREF_URI a rdf:Property .
?MREF_URI rdfs:domain ?CLASS_URI .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-04-03 09:52:03
|
Revision: 570
http://sourceforge.net/p/deductions/code/570
Author: jmvanel
Date: 2017-04-03 09:52:01 +0000 (Mon, 03 Apr 2017)
Log Message:
-----------
ametys_view2owl.n3 : WIP: owl:Class are proper URI's, not blank nodes
Modified Paths:
--------------
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-04-03 08:32:44 UTC (rev 569)
+++ n3_nojs/ametys_view2owl.n3 2017-04-03 09:52:01 UTC (rev 570)
@@ -23,6 +23,7 @@
# prefix created by Gloze lift:
@prefix ametysprops: <http://example.org#> .
@prefix : <http://example.org#> .
+@prefix ded: <http://deductions.com#> .
# transform Ametys CMS views into OWL ("direct mapping")
@@ -36,24 +37,44 @@
""" .
{
+ _:dd1 e:trace ( "????????????" ).
?S cms_:metadata-set ?O .
?O ametysprops:type "edition" .
?O ametysprops:name "main" .
+ _:dd e:trace( "?O" ?O ).
?O cms_:fieldset ?FIELDSET .
?FIELDSET cms_:label ?LABEL_BN .
?LABEL_BN rdf:value ?LABEL .
+ _:dd e:trace ( "?LABEL" ?LABEL ).
+
?FIELDSET cms_:fieldset ?FIELDSET2 .
?FIELDSET2 cms_:metadata-ref ?MREF_BN .
?MREF_BN ametysprops:name ?MREF.
?MREF_URI log:uri ?MREF .
-
+
+ (?LABEL " " "_") string:replace ?NEW_CLASS .
+ ?CLASS_URI log:uri ?NEW_CLASS .
+ # _:dd e:trace ( "?NEW_CLASS" ?NEW_CLASS ).
+ # _:dd e:trace ( "?CLASS_URI" ?CLASS_URI ).
+
+ ?CLASS cms_:content-type ?TYPE .
+ # _:dd e:trace ( "?TYPE" ?TYPE ).
+ (?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
+ _:dd e:trace ( "?RELCLASS" ?RELCLASS ).
+
} => {
- ?FIELDSET a owl:Class .
- ?FIELDSET rdfs:label ?LABEL .
- ?FIELDSET ametys:classHasProperty ?MREF_URI .
+ # ?FIELDSET
+ ?CLASS_URI
+ a owl:Class .
+ ?CLASS_URI
+ rdfs:label ?LABEL .
+ ?CLASS_URI
+ ded:classHasProperty ?MREF_URI .
+ ?CLASS_URI
+ rdfs:subClassOf ?RELCLASS .
?MREF_URI a rdf:Property .
- ?MREF_URI rdfs:domain ?FIELDSET .
+ ?MREF_URI rdfs:domain ?CLASS_URI .
} .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-04-03 08:32:45
|
Revision: 569
http://sourceforge.net/p/deductions/code/569
Author: jmvanel
Date: 2017-04-03 08:32:44 +0000 (Mon, 03 Apr 2017)
Log Message:
-----------
ametys_view2owl.n3 : WIP: create owl:Class for each view, as blank nodes
Modified Paths:
--------------
n3_nojs/ametys_view2owl.n3
Modified: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 2017-04-03 08:02:14 UTC (rev 568)
+++ n3_nojs/ametys_view2owl.n3 2017-04-03 08:32:44 UTC (rev 569)
@@ -47,9 +47,13 @@
?FIELDSET cms_:fieldset ?FIELDSET2 .
?FIELDSET2 cms_:metadata-ref ?MREF_BN .
?MREF_BN ametysprops:name ?MREF.
+ ?MREF_URI log:uri ?MREF .
} => {
- ?S cms_:metadata-set ?O .
- ?FIELDSET cms_:label ?LABEL .
- ?FIELDSET ametys:property ?MREF.
+ ?FIELDSET a owl:Class .
+ ?FIELDSET rdfs:label ?LABEL .
+ ?FIELDSET ametys:classHasProperty ?MREF_URI .
+
+ ?MREF_URI a rdf:Property .
+ ?MREF_URI rdfs:domain ?FIELDSET .
} .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2017-04-03 08:02:16
|
Revision: 568
http://sourceforge.net/p/deductions/code/568
Author: jmvanel
Date: 2017-04-03 08:02:14 +0000 (Mon, 03 Apr 2017)
Log Message:
-----------
add ametys_view2owl.n3 : WIP: just report views
Modified Paths:
--------------
n3_nojs/owl_to_uml.n3
n3_nojs/owl_to_uml.sed
Added Paths:
-----------
n3_nojs/ametys_view2owl.n3
Added: n3_nojs/ametys_view2owl.n3
===================================================================
--- n3_nojs/ametys_view2owl.n3 (rev 0)
+++ n3_nojs/ametys_view2owl.n3 2017-04-03 08:02:14 UTC (rev 568)
@@ -0,0 +1,55 @@
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#>.
+@prefix dc: <http://purl.org/dc/elements/1.1/>.
+@prefix owl: <http://www.w3.org/2002/07/owl#>.
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
+
+@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#>.
+@prefix fn: <http://www.w3.org/2006/xpath-functions#>.
+@prefix list: <http://www.w3.org/2000/10/swap/list#>.
+@prefix log: <http://www.w3.org/2000/10/swap/log#>.
+@prefix math: <http://www.w3.org/2000/10/swap/math#>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
+@prefix string: <http://www.w3.org/2000/10/swap/string#>.
+@prefix time: <http://www.w3.org/2000/10/swap/time#>.
+@prefix func: <http://www.w3.org/2007/rif-builtin-function#>.
+@prefix pred: <http://www.w3.org/2007/rif-builtin-predicate#>.
+@prefix prolog: <http://eulersharp.sourceforge.net/2003/03swap/prolog#>.
+
+@prefix onisepd: <http://data.onisep.fr/resource/> .
+@prefix cms: <http://www.ametys.org/schema/cms> .
+@prefix cms_: <http://www.ametys.org/schema/cms#> .
+@prefix onisep: <http://data.onisep.fr/ontologie#> .
+@prefix ametys: <http://deductions.sf.net/ametys.ttl#> .
+# prefix created by Gloze lift:
+@prefix ametysprops: <http://example.org#> .
+@prefix : <http://example.org#> .
+
+# transform Ametys CMS views into OWL ("direct mapping")
+
+<> rdfs:comment """
+ <cms:metadata-set name="main" type="edition">
+ <cms:metadata-ref name="title" />
+ <cms:fieldset role="tab">
+ <cms:label i18n="false">Carte d'identité</cms:label>
+ <cms:fieldset role="fieldset">
+ <cms:label i18n="false">Libellés</cms:label>
+""" .
+
+{
+ ?S cms_:metadata-set ?O .
+ ?O ametysprops:type "edition" .
+ ?O ametysprops:name "main" .
+
+ ?O cms_:fieldset ?FIELDSET .
+ ?FIELDSET cms_:label ?LABEL_BN .
+ ?LABEL_BN rdf:value ?LABEL .
+
+ ?FIELDSET cms_:fieldset ?FIELDSET2 .
+ ?FIELDSET2 cms_:metadata-ref ?MREF_BN .
+ ?MREF_BN ametysprops:name ?MREF.
+
+} => {
+ ?S cms_:metadata-set ?O .
+ ?FIELDSET cms_:label ?LABEL .
+ ?FIELDSET ametys:property ?MREF.
+} .
Modified: n3_nojs/owl_to_uml.n3
===================================================================
--- n3_nojs/owl_to_uml.n3 2016-12-08 16:22:22 UTC (rev 567)
+++ n3_nojs/owl_to_uml.n3 2017-04-03 08:02:14 UTC (rev 568)
@@ -20,6 +20,7 @@
# maybe use converter in SAAS: http://modeling-languages.com/xmi2-tool-exchanging-uml-models-among-case-tools/
:root UML:Model <uml:model> .
+# <uml:model> UML:name "OWL_Model" .
{ ?C a owl:Class .
# exclude owl:unionOf
@@ -53,16 +54,23 @@
( ?LABEL ) string:concatenation ?AssociationLabel .
( ?P ?CDOMAIN ?CRANGE "#Association" ) string:concatenation ?AssociationID .
# _:d e:trace ( "Association" ?LABEL ?CDOMAIN_LABEL "->" ?CRANGE_LABEL ) .
+ ( ?P ?CDOMAIN ?CRANGE "#AssociationEnd1" ) string:concatenation ?AssociationEnd1ID .
+ ( ?P ?CRANGE ?CDOMAIN "#AssociationEnd2" ) string:concatenation ?AssociationEnd2ID .
} => {
?PBN UML:Association [
UML:name ?AssociationLabel ;
<uml:xmi.id> ?AssociationID ;
+ UML:isSpecification false ; UML:isRoot false ; UML:isLeaf false ; UML:isAbstract false ;
UML:Association.connection [
UML:AssociationEnd
- [ UML:isNavigable false ;
+ [ <uml:xmi.id> ?AssociationEnd1ID ;
+ UML:isNavigable false ; UML:isSpecification false ;
+ UML:ordering "unordered" ; UML:aggregation "none" ; UML:targetScope "instance" ;
UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CDOMAINURI ] ] ] ;
UML:AssociationEnd
- [ UML:isNavigable true ;
+ [ <uml:xmi.id> ?AssociationEnd2ID ;
+ UML:isNavigable true ; UML:isSpecification false ;
+ UML:ordering "unordered" ; UML:aggregation "none" ; UML:targetScope "instance" ;
UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CRANGEURI ] ] ]
]
] .
Modified: n3_nojs/owl_to_uml.sed
===================================================================
--- n3_nojs/owl_to_uml.sed 2016-12-08 16:22:22 UTC (rev 567)
+++ n3_nojs/owl_to_uml.sed 2017-04-03 08:02:14 UTC (rev 568)
@@ -15,6 +15,18 @@
1,$s=</TaggedValue.dataValue>=</UML:TaggedValue.dataValue>=
1,$s/UML:isNavigable/isNavigable/
+1,$s/UML:isAbstract/isAbstract/
+1,$s/UML:isLeaf/isLeaf/
+1,$s/UML:isRoot/isRoot/
+1,$s/NS1:isLeaf/isLeaf/
+1,$s/NS1:isRoot/isRoot/
+1,$s/UML:isSpecification/isSpecification/
+1,$s/NS1:isSpecification/isSpecification/
+1,$s/NS1:name/name/
+1,$s/UML:ordering/ordering/
+1,$s/UML:aggregation/aggregation/
+1,$s/UML:targetScope/targetScope/
+1,$s/NS1:targetScope/targetScope/
/^<?xml .*/ a \
<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' >\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-12-08 16:22:25
|
Revision: 567
http://sourceforge.net/p/deductions/code/567
Author: jmvanel
Date: 2016-12-08 16:22:22 +0000 (Thu, 08 Dec 2016)
Log Message:
-----------
ametys_content-type2owl.q.n3 : add triples like : <AbstractMetier/remuneration> ametys:subform-type "repeater".
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.q.n3
n3_nojs/ametys_content-type2owl_embedded.n3
Modified: n3_nojs/ametys_content-type2owl.q.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.q.n3 2016-12-08 16:08:13 UTC (rev 566)
+++ n3_nojs/ametys_content-type2owl.q.n3 2016-12-08 16:22:22 UTC (rev 567)
@@ -98,7 +98,6 @@
{ # owl:ObjectProperty and owl:Class from <cms:metadata type="composite"> or <cms:repeater">
?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER).
- _:t e:trace ( "m102 ?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER)" ?CLASS_URI "ametys:class-node-embedded-parent (" ?AMETYS_CLASS ?CONTAINER ).
_:e e:optional {
?AMETYS_CLASS cms_:label [ rdf:value ?LABEL ] .
?CONTAINER cms_:label [ rdf:value ?LABEL_CONTAINER ] .
@@ -106,12 +105,13 @@
} .
(?AMETYS_CLASS "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
- _:t e:trace ( "m113 ametys:get-content-type-root ( ?ROOT " ?ROOT "?PROP_URI" ?PROP_URI ) .
(?PROP_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
# _:t e:trace (" ?ROOT ?PROP_URI" ?ROOT ?PROP_URI "?EMBEDED_CLASS" ?EMBEDED_CLASS).
- (?CONTAINER "") ametys:get-content-type-root ( ?ROOT ?CONTAINER_URI )
+ (?CONTAINER "") ametys:get-content-type-root ( ?ROOT ?CONTAINER_URI ) .
+ _:e e:optional { ?PROP_URI ametys:subform-type ?AMETYS_TYPE . } .
} => {
+
?EMBEDED_CLASS a owl:Class ;
rdfs:label ?LABEL2 ;
ametys:label ?LABEL ;
@@ -123,7 +123,7 @@
rdfs:domain ?CONTAINER_URI ;
a owl:ObjectProperty ;
rdfs:label ?LABEL ;
- # ametys:type ?AMETYS_TYPE ;
+ ametys:subform-type ?AMETYS_TYPE .
}.
Modified: n3_nojs/ametys_content-type2owl_embedded.n3
===================================================================
--- n3_nojs/ametys_content-type2owl_embedded.n3 2016-12-08 16:08:13 UTC (rev 566)
+++ n3_nojs/ametys_content-type2owl_embedded.n3 2016-12-08 16:22:22 UTC (rev 567)
@@ -100,6 +100,7 @@
?CLASS_URI ametys:class-node-embedded ?TYPE .
?CLASS_URI ametys:class-node-embedded-parent (?TYPE ?CONTAINER).
?CLASS_URI ametys:class-node-parent (?CONTAINER).
+ ?CLASS_URI ametys:subform-type "composite" .
} .
{ ?CONTAINER cms_:repeater ?TYPE .
@@ -110,5 +111,6 @@
?CLASS_URI ametys:class-node-embedded ?TYPE .
?CLASS_URI ametys:class-node-embedded-parent (?TYPE ?CONTAINER).
?CLASS_URI ametys:class-node-parent (?CONTAINER).
+ ?CLASS_URI ametys:subform-type "repeater" .
} .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-12-08 16:08:14
|
Revision: 566
http://sourceforge.net/p/deductions/code/566
Author: jmvanel
Date: 2016-12-08 16:08:13 +0000 (Thu, 08 Dec 2016)
Log Message:
-----------
ametys_content-type2owl.q.n3 : FIX missing triples like <AbstractMetier/remuneration> rdfs:domain <AbstractMetier>.
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.q.n3
Modified: n3_nojs/ametys_content-type2owl.q.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.q.n3 2016-10-26 20:00:36 UTC (rev 565)
+++ n3_nojs/ametys_content-type2owl.q.n3 2016-12-08 16:08:13 UTC (rev 566)
@@ -83,11 +83,13 @@
{
# ?PROP_URI ametys:property-node ?AMETYS_PROP .
- ?TYPE cms_:metadata ?AMETYS_PROP .
?ROOT cms_:content-type ?TYPE .
+ _:e0 e:optional { ?TYPE cms_:metadata ?AMETYS_PROP . } .
+ _:e1 e:optional { ?TYPE cms_:repeater ?AMETYS_PROP . } .
(?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
(?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
_:e e:optional { ?AMETYS_PROP ametysprops:name ?PROPNAME . } .
+ # _:t e:trace ( "m93" ?PROP_URI "?PROP_URI" "rdfs:domain" "?RELCLASS" ?RELCLASS ) .
} => {
?PROP_URI
rdfs:domain ?RELCLASS ;
@@ -96,30 +98,30 @@
{ # owl:ObjectProperty and owl:Class from <cms:metadata type="composite"> or <cms:repeater">
?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER).
- # _:t e:trace ( "?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER)" ?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER) ).
+ _:t e:trace ( "m102 ?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER)" ?CLASS_URI "ametys:class-node-embedded-parent (" ?AMETYS_CLASS ?CONTAINER ).
_:e e:optional {
?AMETYS_CLASS cms_:label [ rdf:value ?LABEL ] .
?CONTAINER cms_:label [ rdf:value ?LABEL_CONTAINER ] .
( ?LABEL " @ " ?LABEL_CONTAINER ) func:concat ?LABEL2 .
} .
- _:f e:optional {
- ?CONTAINER ametys:class-node-parent (?PARENT) .
- (?PARENT "") ametys:get-content-type-root (?ROOT2 ?RELCLASS_OUTER ) .
- # _:t e:trace ( "?ROOT2 ?RELCLASS_OUTER" ?ROOT2 ?RELCLASS_OUTER ).
- } .
+
(?AMETYS_CLASS "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
- # _:t e:trace (" ?ROOT ?PROP_URI" ?ROOT ?PROP_URI ).
+ _:t e:trace ( "m113 ametys:get-content-type-root ( ?ROOT " ?ROOT "?PROP_URI" ?PROP_URI ) .
(?PROP_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
+ # _:t e:trace (" ?ROOT ?PROP_URI" ?ROOT ?PROP_URI "?EMBEDED_CLASS" ?EMBEDED_CLASS).
+
+ (?CONTAINER "") ametys:get-content-type-root ( ?ROOT ?CONTAINER_URI )
} => {
?EMBEDED_CLASS a owl:Class ;
rdfs:label ?LABEL2 ;
ametys:label ?LABEL ;
# ametys:type ?AMETYS_TYPE ;
- ametys:embeddedIn ?RELCLASS_OUTER ;
+ ametys:embeddedIn ?CONTAINER_URI ;
rdfs:subClassOf ametys:Details .
- ?PROP_URI rdfs:range ?EMBEDED_CLASS .
- ?PROP_URI a owl:ObjectProperty ;
+ ?PROP_URI rdfs:range ?EMBEDED_CLASS ;
+ rdfs:domain ?CONTAINER_URI ;
+ a owl:ObjectProperty ;
rdfs:label ?LABEL ;
# ametys:type ?AMETYS_TYPE ;
}.
@@ -170,6 +172,7 @@
(?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
(?CLASS_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
+ # _:t e:trace ( "?EMBEDED_CLASS" ?EMBEDED_CLASS "?PROP_URI" ?PROP_URI "rdfs:domain" "?EMBEDED_CLASS" ?EMBEDED_CLASS).
} => {
?PROP_URI rdfs:domain ?EMBEDED_CLASS .
}.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-10-26 20:00:37
|
Revision: 565
http://sourceforge.net/p/deductions/code/565
Author: jmvanel
Date: 2016-10-26 20:00:36 +0000 (Wed, 26 Oct 2016)
Log Message:
-----------
owl2uml.sh : the script can now take an ontology as URL for input
Modified Paths:
--------------
n3_nojs/owl2uml.sh
Modified: n3_nojs/owl2uml.sh
===================================================================
--- n3_nojs/owl2uml.sh 2016-10-21 17:12:16 UTC (rev 564)
+++ n3_nojs/owl2uml.sh 2016-10-26 20:00:36 UTC (rev 565)
@@ -1,10 +1,36 @@
INPUT=$1
-FILE=`basename $1`
-echo $FILE
+# FILE=`basename $1`
+# echo $FILE
+urlencode() {
+ # urlencode <string>
+ old_lc_collate=$LC_COLLATE
+ LC_COLLATE=C
+
+ local length="${#1}"
+ for (( i = 0; i < length; i++ )); do
+ local c="${1:i:1}"
+ case $c in
+ [a-zA-Z0-9.~_-]) printf "$c" ;;
+ *) printf '%%%02X' "'$c" ;;
+ esac
+ done
+
+ LC_COLLATE=$old_lc_collate
+}
+
+# 0. download and convert to Turtle
+TTL=/tmp/download.ttl
+TTL2=`urlencode $INPUT`.ttl
+rapper $INPUT > $TTL
+echo downloaded $TTL from $INPUT
+
# 1. Convert OWL in UML but in RDF syntax:
-/opt/eye/bin/eye.sh $INPUT --nope --pass ~/src/deductions-code/n3_nojs/owl_to_uml.n3 > $FILE.uml.ttl
-# rapper -i turtle $FILE.uml.ttl -o turtle > $FILE.uml2.ttl
+echo /opt/eye/bin/eye.sh file://$TTL --nope --pass file://$HOME/src/deductions-code/n3_nojs/owl_to_uml.n3 \> $TTL.uml.ttl
+/opt/eye/bin/eye.sh file://$TTL --nope --pass file://$HOME/src/deductions-code/n3_nojs/owl_to_uml.n3 > $TTL.uml.ttl
+# rapper -i turtle $TTL.uml.ttl -o turtle > $TTL.uml2.ttl
+echo generated $TTL.uml.ttl
+ls -l $TTL.uml.ttl
# 2. Convert RDF in XML:
source ~/src/Gloze/setClasspath.sh
@@ -14,11 +40,11 @@
-Dgloze.verbose=true \
-Dgloze.order=seq \
com.hp.gloze.GlozeURL \
-$FILE.uml.ttl \
-> /tmp/$FILE.uml2.xml
+$TTL.uml.ttl \
+> $TTL.uml2.xml
# 3. Final cleaning of XMI for ArgoUML:
-sed -f ~/src/deductions-code/n3_nojs/owl_to_uml.sed /tmp/$FILE.uml2.xml > $INPUT.xmi
-echo generated $INPUT.xmi
+sed -f ~/src/deductions-code/n3_nojs/owl_to_uml.sed $TTL.uml2.xml > $TTL2.xmi
+echo generated $TTL2.xmi
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-10-21 17:12:19
|
Revision: 564
http://sourceforge.net/p/deductions/code/564
Author: jmvanel
Date: 2016-10-21 17:12:16 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
owl_to_uml.n3 : add arrow for properties to distinguish domain and range, in UML it's navigability.
Modified Paths:
--------------
n3_nojs/owl2uml.sh
n3_nojs/owl_to_uml.n3
n3_nojs/owl_to_uml.sed
Modified: n3_nojs/owl2uml.sh
===================================================================
--- n3_nojs/owl2uml.sh 2016-10-21 16:09:50 UTC (rev 563)
+++ n3_nojs/owl2uml.sh 2016-10-21 17:12:16 UTC (rev 564)
@@ -2,11 +2,11 @@
FILE=`basename $1`
echo $FILE
-# 1. Convertir OWL en UML mais en syntaxe RDF:
+# 1. Convert OWL in UML but in RDF syntax:
/opt/eye/bin/eye.sh $INPUT --nope --pass ~/src/deductions-code/n3_nojs/owl_to_uml.n3 > $FILE.uml.ttl
-rapper -i turtle $FILE.uml.ttl -o turtle > $FILE.uml2.ttl
+# rapper -i turtle $FILE.uml.ttl -o turtle > $FILE.uml2.ttl
-# 2. Convertir RDF en XML:
+# 2. Convert RDF in XML:
source ~/src/Gloze/setClasspath.sh
java -cp $LIBS \
-Dgloze.lang=N3 \
@@ -17,7 +17,7 @@
$FILE.uml.ttl \
> /tmp/$FILE.uml2.xml
-# 3. mettre en forme le XMI:
+# 3. Final cleaning of XMI for ArgoUML:
sed -f ~/src/deductions-code/n3_nojs/owl_to_uml.sed /tmp/$FILE.uml2.xml > $INPUT.xmi
echo generated $INPUT.xmi
Modified: n3_nojs/owl_to_uml.n3
===================================================================
--- n3_nojs/owl_to_uml.n3 2016-10-21 16:09:50 UTC (rev 563)
+++ n3_nojs/owl_to_uml.n3 2016-10-21 17:12:16 UTC (rev 564)
@@ -49,7 +49,8 @@
?P rdfs:label ?LABEL .
# ( ?LABEL ) func:lang-from-PlainLiteral "fr" .
- ( ?LABEL ", " ?CDOMAIN_LABEL " -> " ?CRANGE_LABEL ) string:concatenation ?AssociationLabel .
+ # ( ?LABEL ", " ?CDOMAIN_LABEL " -> " ?CRANGE_LABEL ) string:concatenation ?AssociationLabel .
+ ( ?LABEL ) string:concatenation ?AssociationLabel .
( ?P ?CDOMAIN ?CRANGE "#Association" ) string:concatenation ?AssociationID .
# _:d e:trace ( "Association" ?LABEL ?CDOMAIN_LABEL "->" ?CRANGE_LABEL ) .
} => {
@@ -58,9 +59,11 @@
<uml:xmi.id> ?AssociationID ;
UML:Association.connection [
UML:AssociationEnd
- [ UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CDOMAINURI ] ] ] ;
+ [ UML:isNavigable false ;
+ UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CDOMAINURI ] ] ] ;
UML:AssociationEnd
- [ UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CRANGEURI ] ] ]
+ [ UML:isNavigable true ;
+ UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CRANGEURI ] ] ]
]
] .
<uml:model> UML:Namespace.ownedElement ?PBN .
Modified: n3_nojs/owl_to_uml.sed
===================================================================
--- n3_nojs/owl_to_uml.sed 2016-10-21 16:09:50 UTC (rev 563)
+++ n3_nojs/owl_to_uml.sed 2016-10-21 17:12:16 UTC (rev 564)
@@ -14,6 +14,7 @@
1,$s/UML:xmi.id=/xmi.id=/
1,$s=</TaggedValue.dataValue>=</UML:TaggedValue.dataValue>=
+1,$s/UML:isNavigable/isNavigable/
/^<?xml .*/ a \
<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' >\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-10-21 16:09:52
|
Revision: 563
http://sourceforge.net/p/deductions/code/563
Author: jmvanel
Date: 2016-10-21 16:09:50 +0000 (Fri, 21 Oct 2016)
Log Message:
-----------
owl_to_uml.n3 : FIX generation of UML associations: tested with FOAF on ArgoUML 0.34
add script owl2uml.sh
TODO: add datatypes to UML attributes ( == OWL datatype properties )
Modified Paths:
--------------
n3_nojs/owl_to_uml.n3
Added Paths:
-----------
n3_nojs/owl2uml.sh
Added: n3_nojs/owl2uml.sh
===================================================================
--- n3_nojs/owl2uml.sh (rev 0)
+++ n3_nojs/owl2uml.sh 2016-10-21 16:09:50 UTC (rev 563)
@@ -0,0 +1,24 @@
+INPUT=$1
+FILE=`basename $1`
+echo $FILE
+
+# 1. Convertir OWL en UML mais en syntaxe RDF:
+/opt/eye/bin/eye.sh $INPUT --nope --pass ~/src/deductions-code/n3_nojs/owl_to_uml.n3 > $FILE.uml.ttl
+rapper -i turtle $FILE.uml.ttl -o turtle > $FILE.uml2.ttl
+
+# 2. Convertir RDF en XML:
+source ~/src/Gloze/setClasspath.sh
+java -cp $LIBS \
+-Dgloze.lang=N3 \
+-Dgloze.base="file://$HOME/src/deductions-code/n3_nojs/owl_to_uml.n3#root" \
+-Dgloze.verbose=true \
+-Dgloze.order=seq \
+com.hp.gloze.GlozeURL \
+$FILE.uml.ttl \
+> /tmp/$FILE.uml2.xml
+
+# 3. mettre en forme le XMI:
+sed -f ~/src/deductions-code/n3_nojs/owl_to_uml.sed /tmp/$FILE.uml2.xml > $INPUT.xmi
+echo generated $INPUT.xmi
+
+
Property changes on: n3_nojs/owl2uml.sh
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Modified: n3_nojs/owl_to_uml.n3
===================================================================
--- n3_nojs/owl_to_uml.n3 2016-10-19 08:50:50 UTC (rev 562)
+++ n3_nojs/owl_to_uml.n3 2016-10-21 16:09:50 UTC (rev 563)
@@ -6,7 +6,9 @@
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#> .
@prefix ded: <http://deductions.com#> .
@prefix string: <http://www.w3.org/2000/10/swap/string#>.
+@prefix func: <http://www.w3.org/2007/rif-builtin-function#> .
+
# convert OWL to UML ( ArgoUML metamodel in RDF canonical XML mapping (Gloze) )
# use with --pass ( XML export in EuleGUI will find the XML root )
@@ -45,18 +47,20 @@
?CDOMAIN rdfs:label ?CDOMAIN_LABEL .
?CRANGE rdfs:label ?CRANGE_LABEL .
?P rdfs:label ?LABEL .
+ # ( ?LABEL ) func:lang-from-PlainLiteral "fr" .
+
( ?LABEL ", " ?CDOMAIN_LABEL " -> " ?CRANGE_LABEL ) string:concatenation ?AssociationLabel .
( ?P ?CDOMAIN ?CRANGE "#Association" ) string:concatenation ?AssociationID .
- # ( ?P "#Association" ) string:concatenation ?AssociationID .
+ # _:d e:trace ( "Association" ?LABEL ?CDOMAIN_LABEL "->" ?CRANGE_LABEL ) .
} => {
?PBN UML:Association [
- # UML:name ?LABEL ;
UML:name ?AssociationLabel ;
<uml:xmi.id> ?AssociationID ;
UML:Association.connection [
UML:AssociationEnd
- [ UML:AssociationEnd.participant [ <uml:xmi.idref> ?CDOMAINURI ] ] ,
- [ UML:AssociationEnd.participant [ <uml:xmi.idref> ?CRANGEURI ] ]
+ [ UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CDOMAINURI ] ] ] ;
+ UML:AssociationEnd
+ [ UML:AssociationEnd.participant [ UML:Class [ <uml:xmi.idref> ?CRANGEURI ] ] ]
]
] .
<uml:model> UML:Namespace.ownedElement ?PBN .
@@ -105,6 +109,11 @@
] ] ] .
} .
+{ ?CLASS rdfs:subClassOf ?CLASS .
+ _:d e:trace ( "CAUTION: self-inheritance" ?CLASS ) .
+} => {
+} .
+
{ ?CHILD rdfs:subClassOf ?PARENT .
# ?CHILD ded:bn_for_uri ?CHILDBN .
# ?PARENT ded:bn_for_uri ?PARENTBN .
@@ -117,6 +126,7 @@
?CHILD rdfs:label ?CHILD_LABEL .
?PARENT rdfs:label ?PARENT_LABEL .
(?CHILD_LABEL " -> " ?PARENT_LABEL ) string:concatenation ?GeneralizationLabel .
+ # _:d e:trace ( "inheritance" ?CHILD rdfs:subClassOf ?PARENT ) .
} => {
?GEN UML:Generalization [ <uml:xmi.id> ?GeneralizationID ;
UML:name ?GeneralizationLabel ;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-10-19 08:50:52
|
Revision: 562
http://sourceforge.net/p/deductions/code/562
Author: jmvanel
Date: 2016-10-19 08:50:50 +0000 (Wed, 19 Oct 2016)
Log Message:
-----------
owl_to_uml.n" : enhance ?AssociationID for the cas of multiple rdfs:domain's ; add ?LABEL of owl:ObjectProperty to UML:Association
Modified Paths:
--------------
n3_nojs/owl_to_uml.n3
Modified: n3_nojs/owl_to_uml.n3
===================================================================
--- n3_nojs/owl_to_uml.n3 2016-10-18 17:40:55 UTC (rev 561)
+++ n3_nojs/owl_to_uml.n3 2016-10-19 08:50:50 UTC (rev 562)
@@ -44,10 +44,13 @@
?CDOMAIN rdfs:label ?CDOMAIN_LABEL .
?CRANGE rdfs:label ?CRANGE_LABEL .
- (?CDOMAIN_LABEL " -> " ?CRANGE_LABEL ) string:concatenation ?AssociationLabel .
-( ?CDOMAIN ?CRANGE "#Association" ) string:concatenation ?AssociationID .
-} => {
+ ?P rdfs:label ?LABEL .
+ ( ?LABEL ", " ?CDOMAIN_LABEL " -> " ?CRANGE_LABEL ) string:concatenation ?AssociationLabel .
+ ( ?P ?CDOMAIN ?CRANGE "#Association" ) string:concatenation ?AssociationID .
+ # ( ?P "#Association" ) string:concatenation ?AssociationID .
+} => {
?PBN UML:Association [
+ # UML:name ?LABEL ;
UML:name ?AssociationLabel ;
<uml:xmi.id> ?AssociationID ;
UML:Association.connection [
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-10-18 17:40:56
|
Revision: 561
http://sourceforge.net/p/deductions/code/561
Author: jmvanel
Date: 2016-10-18 17:40:55 +0000 (Tue, 18 Oct 2016)
Log Message:
-----------
owl_to_uml.n3: add Generalization and Association Label; AssociationID; translate rdfs:comment ; exclude classes being owl:unionOf
Modified Paths:
--------------
n3_nojs/owl_to_uml.n3
n3_nojs/owl_to_uml.sed
Modified: n3_nojs/owl_to_uml.n3
===================================================================
--- n3_nojs/owl_to_uml.n3 2016-10-12 09:57:46 UTC (rev 560)
+++ n3_nojs/owl_to_uml.n3 2016-10-18 17:40:55 UTC (rev 561)
@@ -1,4 +1,5 @@
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix owl: <http://www.w3.org/2002/07/owl#>.
@prefix UML: <uml:org.omg.xmi.namespace.UML#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@@ -19,6 +20,9 @@
:root UML:Model <uml:model> .
{ ?C a owl:Class .
+ # exclude owl:unionOf
+ _:d e:findall ( ?LIST {
+ ?C owl:unionOf ?LIST. } () ).
?C log:uri ?URI .
# _:d e:trace ( ?C "a" owl:Class ).
} => {
@@ -35,10 +39,17 @@
?P log:uri ?URI .
# ?CDOMAIN ded:bn_for_uri ?CDOMAINBN .
# ?CRANGE ded:bn_for_uri ?CRANGEBN .
- ?CDOMAIN log:uri ?CDOMAINURI .
- ?CRANGE log:uri ?CRANGEURI .
+ ?CDOMAIN log:uri ?CDOMAINURI .
+ ?CRANGE log:uri ?CRANGEURI .
+
+ ?CDOMAIN rdfs:label ?CDOMAIN_LABEL .
+ ?CRANGE rdfs:label ?CRANGE_LABEL .
+ (?CDOMAIN_LABEL " -> " ?CRANGE_LABEL ) string:concatenation ?AssociationLabel .
+( ?CDOMAIN ?CRANGE "#Association" ) string:concatenation ?AssociationID .
} => {
?PBN UML:Association [
+ UML:name ?AssociationLabel ;
+ <uml:xmi.id> ?AssociationID ;
UML:Association.connection [
UML:AssociationEnd
[ UML:AssociationEnd.participant [ <uml:xmi.idref> ?CDOMAINURI ] ] ,
@@ -46,7 +57,6 @@
]
] .
<uml:model> UML:Namespace.ownedElement ?PBN .
- ?PBN <uml:xmi.id> ?URI .
} .
{ ?P a owl:DatatypeProperty ;
@@ -69,8 +79,9 @@
] ] .
} .
+
{ ?X ded:bn_for_uri ?BN } <= {
- # _:d e:trace ( ?X ded:bn_for_uri ?BN ) .
+ # Relation between blank node (used in structure XML) and input URL (from OWL model)
?X log:uri ?URI .
?BN <uml:xmi.id> ?URI .
}.
@@ -81,15 +92,31 @@
?BN UML:name ?LABEL .
} .
+{ ?URI rdfs:comment ?COMMENT .
+ ?URI ded:bn_for_uri ?BN .
+} => {
+ ?BN UML:ModelElement.taggedValue
+ [ UML:TaggedValue
+ [ UML:TaggedValue.dataValue
+ [ rdf:value ?COMMENT
+ ] ] ] .
+} .
+
{ ?CHILD rdfs:subClassOf ?PARENT .
# ?CHILD ded:bn_for_uri ?CHILDBN .
# ?PARENT ded:bn_for_uri ?PARENTBN .
?CHILD log:uri ?CHILDURI .
?PARENT log:uri ?PARENTURI .
?CHILDBN <uml:xmi.id> ?CHILDURI .
- ( ?CHILDURI "#Generalization" ) string:concatenation ?GeneralizationID .
+ ( ?CHILDURI ?PARENT "#Generalization" ) string:concatenation ?GeneralizationID .
+
+ # ?PARENTBN <uml:xmi.id> ?PARENTURI .
+ ?CHILD rdfs:label ?CHILD_LABEL .
+ ?PARENT rdfs:label ?PARENT_LABEL .
+ (?CHILD_LABEL " -> " ?PARENT_LABEL ) string:concatenation ?GeneralizationLabel .
} => {
?GEN UML:Generalization [ <uml:xmi.id> ?GeneralizationID ;
+ UML:name ?GeneralizationLabel ;
UML:Generalization.child [ UML:Class [ <uml:xmi.idref> ?CHILDURI ] ] ;
UML:Generalization.parent [ UML:Class [ <uml:xmi.idref> ?PARENTURI ] ]
] .
Modified: n3_nojs/owl_to_uml.sed
===================================================================
--- n3_nojs/owl_to_uml.sed 2016-10-12 09:57:46 UTC (rev 560)
+++ n3_nojs/owl_to_uml.sed 2016-10-18 17:40:55 UTC (rev 561)
@@ -13,6 +13,8 @@
1,$s/UML:xmi.idref=/xmi.idref=/
1,$s/UML:xmi.id=/xmi.id=/
+1,$s=</TaggedValue.dataValue>=</UML:TaggedValue.dataValue>=
+
/^<?xml .*/ a \
<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' >\
<XMI.header>\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-10-12 09:57:49
|
Revision: 560
http://sourceforge.net/p/deductions/code/560
Author: jmvanel
Date: 2016-10-12 09:57:46 +0000 (Wed, 12 Oct 2016)
Log Message:
-----------
FIX owl_to_uml.sed
Modified Paths:
--------------
n3_nojs/owl_to_uml.sed
Modified: n3_nojs/owl_to_uml.sed
===================================================================
--- n3_nojs/owl_to_uml.sed 2016-10-12 09:05:24 UTC (rev 559)
+++ n3_nojs/owl_to_uml.sed 2016-10-12 09:57:46 UTC (rev 560)
@@ -10,6 +10,9 @@
1,$s/NS1:/UML:/
1,$s/UML:name="/name="/
+1,$s/UML:xmi.idref=/xmi.idref=/
+1,$s/UML:xmi.id=/xmi.id=/
+
/^<?xml .*/ a \
<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' >\
<XMI.header>\
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-10-12 09:05:26
|
Revision: 559
http://sourceforge.net/p/deductions/code/559
Author: jmvanel
Date: 2016-10-12 09:05:24 +0000 (Wed, 12 Oct 2016)
Log Message:
-----------
owl_to_uml.n3 : FIX inheritance (WIP)
Modified Paths:
--------------
n3_nojs/owl_to_uml.n3
n3_nojs/owl_to_uml.test.sh
Added Paths:
-----------
n3_nojs/owl_to_uml.sed
Modified: n3_nojs/owl_to_uml.n3
===================================================================
--- n3_nojs/owl_to_uml.n3 2016-07-07 08:21:10 UTC (rev 558)
+++ n3_nojs/owl_to_uml.n3 2016-10-12 09:05:24 UTC (rev 559)
@@ -4,6 +4,7 @@
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix e: <http://eulersharp.sourceforge.net/2003/03swap/log-rules#> .
@prefix ded: <http://deductions.com#> .
+@prefix string: <http://www.w3.org/2000/10/swap/string#>.
# convert OWL to UML ( ArgoUML metamodel in RDF canonical XML mapping (Gloze) )
# use with --pass ( XML export in EuleGUI will find the XML root )
@@ -80,22 +81,26 @@
?BN UML:name ?LABEL .
} .
-{ ?CHILD rdfs:subClassOf ?PARENT .
+{ ?CHILD rdfs:subClassOf ?PARENT .
# ?CHILD ded:bn_for_uri ?CHILDBN .
# ?PARENT ded:bn_for_uri ?PARENTBN .
?CHILD log:uri ?CHILDURI .
?PARENT log:uri ?PARENTURI .
+ ?CHILDBN <uml:xmi.id> ?CHILDURI .
+ ( ?CHILDURI "#Generalization" ) string:concatenation ?GeneralizationID .
} => {
- ?GEN UML:Generalization [
+ ?GEN UML:Generalization [ <uml:xmi.id> ?GeneralizationID ;
UML:Generalization.child [ UML:Class [ <uml:xmi.idref> ?CHILDURI ] ] ;
UML:Generalization.parent [ UML:Class [ <uml:xmi.idref> ?PARENTURI ] ]
] .
<uml:model> UML:Namespace.ownedElement ?GEN .
+
+ ?CHILDBN UML:GeneralizableElement.generalization [ UML:Generalization [ <uml:xmi.idref> ?GeneralizationID ] ] .
} .
# XSD primitive types:
<uml:model> UML:Namespace.ownedElement [
- UML:DataType [ <uml:xmi.id> "http://www.w3.org/2001/XMLSchema#integer" ; UML:name "Integer" ] ;
+ # UML:DataType [ <uml:xmi.id> "http://www.w3.org/2001/XMLSchema#integer" ; UML:name "Integer" ] ;
UML:DataType [ <uml:xmi.id> "http://www.w3.org/2001/XMLSchema#integer" ; UML:name "UnlimitedInteger" ] ;
UML:DataType [ <uml:xmi.id> "http://www.w3.org/2001/XMLSchema#string" ; UML:name "String" ] ;
UML:DataType [ <uml:xmi.id> "http://www.w3.org/2001/XMLSchema#boolean" ; UML:name "Boolean" ]
Added: n3_nojs/owl_to_uml.sed
===================================================================
--- n3_nojs/owl_to_uml.sed (rev 0)
+++ n3_nojs/owl_to_uml.sed 2016-10-12 09:05:24 UTC (rev 559)
@@ -0,0 +1,25 @@
+/gloze/d
+
+1,$s/NS2:xmi.id=/xmi.id=/
+1,$s/NS2:xmi.idref=/xmi.idref=/
+/^<?xml .*/ ! s/</<UML:/
+1,$s=<UML:/=</UML:=
+1,$s/xmlns:NS2="uml:"//
+1,$s/xmlns:NS1="uml:"//
+1,$s/xmlns:NS1="uml:org.omg.xmi.namespace.UML#"//
+1,$s/NS1:/UML:/
+1,$s/UML:name="/name="/
+
+/^<?xml .*/ a \
+<XMI xmi.version = '1.2' xmlns:UML = 'org.omg.xmi.namespace.UML' >\
+<XMI.header>\
+ <XMI.documentation>\
+ <XMI.exporter>ArgoUML (using Netbeans XMI Writer version 1.0)</XMI.exporter>\
+ <XMI.exporterVersion>0.34(6) revised on $Date$ </XMI.exporterVersion>\
+ </XMI.documentation>\
+ <XMI.metamodel xmi.name="UML" xmi.version="1.4"/></XMI.header>\
+ <XMI.content>
+
+$ a \
+ </XMI.content>\
+</XMI>
Modified: n3_nojs/owl_to_uml.test.sh
===================================================================
--- n3_nojs/owl_to_uml.test.sh 2016-07-07 08:21:10 UTC (rev 558)
+++ n3_nojs/owl_to_uml.test.sh 2016-10-12 09:05:24 UTC (rev 559)
@@ -2,3 +2,7 @@
rapper -i turtle /tmp/bb.ttl -o turtle > /tmp/uml.ttl
gvim /tmp/uml.ttl
+# Apply Gloze like:
+echo "java -cp $LIBS -Dgloze.lang=N3 -Dgloze.base='file:///home/jmv/src/deductions-code/n3_nojs/owl_to_uml.n3#root' -Dgloze.verbose=true -Dgloze.order=seq com.hp.gloze.GlozeURL /tmp/uml.ttl 1> /tmp/uml.ttl.xml"
+# and then sed producing a .xmi
+echo "sed -f owl_to_uml.sed /tmp/uml.ttl.xml > /tmp/uml.ttl.xmi"
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-07-07 08:21:13
|
Revision: 558
http://sourceforge.net/p/deductions/code/558
Author: jmvanel
Date: 2016-07-07 08:21:10 +0000 (Thu, 07 Jul 2016)
Log Message:
-----------
FIX: ametys_content-type2owl.q.n3 : rdfs:domain was missing for composite forms
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.q.n3
Modified: n3_nojs/ametys_content-type2owl.q.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.q.n3 2016-07-04 08:58:37 UTC (rev 557)
+++ n3_nojs/ametys_content-type2owl.q.n3 2016-07-07 08:21:10 UTC (rev 558)
@@ -82,10 +82,11 @@
# any Property at root level: set rdfs:domain
{
- ?PROP_URI ametys:property-node ?AMETYS_PROP .
+ # ?PROP_URI ametys:property-node ?AMETYS_PROP .
?TYPE cms_:metadata ?AMETYS_PROP .
?ROOT cms_:content-type ?TYPE .
- (?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
+ (?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
+ (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
_:e e:optional { ?AMETYS_PROP ametysprops:name ?PROPNAME . } .
} => {
?PROP_URI
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-07-04 08:58:41
|
Revision: 557
http://sourceforge.net/p/deductions/code/557
Author: jmvanel
Date: 2016-07-04 08:58:37 +0000 (Mon, 04 Jul 2016)
Log Message:
-----------
ametys_content-type2owl: BIG REFACTORING: rdfs:domain for a property at root level must not use the URI with #class; a property in an embedded class must
FIX intermediary #class creation common for repeater and composite
TODO embeddedIn has disappeared
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.n3
n3_nojs/ametys_content-type2owl.q.n3
n3_nojs/ametys_content-type2owl_embedded.n3
Modified: n3_nojs/ametys_content-type2owl.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.n3 2016-07-02 17:20:51 UTC (rev 556)
+++ n3_nojs/ametys_content-type2owl.n3 2016-07-04 08:58:37 UTC (rev 557)
@@ -134,15 +134,18 @@
(?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
} => {
?PROP_URI ametys:property-node ?AMETYS_PROP .
+ # ?PROP_URI ametys:property-node-parent (?AMETYS_PROP ?CLASS) .
}.
########### structural rules: classes
{ ?ROOT cms_:content-type ?TYPE .
- (?TYPE "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI )
+ (?TYPE "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
+ # _:t e:trace ( "^^^ ?CLASS_URI ametys:class-node-parent (?ROOT)" ?CLASS_URI ametys:class-node-parent ( ?ROOT ) ).
} => {
?CLASS_URI ametys:class-node ?TYPE .
+ ?CLASS_URI ametys:class-node-parent (?ROOT).
}.
Modified: n3_nojs/ametys_content-type2owl.q.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.q.n3 2016-07-02 17:20:51 UTC (rev 556)
+++ n3_nojs/ametys_content-type2owl.q.n3 2016-07-04 08:58:37 UTC (rev 557)
@@ -79,12 +79,12 @@
########### rules for CMS properties
-# any Property: set rdfs:domain
+# any Property at root level: set rdfs:domain
{
?PROP_URI ametys:property-node ?AMETYS_PROP .
- # TODO: when the TYPE is embedded, the URI different with #class
?TYPE cms_:metadata ?AMETYS_PROP .
+ ?ROOT cms_:content-type ?TYPE .
(?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
_:e e:optional { ?AMETYS_PROP ametysprops:name ?PROPNAME . } .
} => {
@@ -94,45 +94,41 @@
}.
{ # owl:ObjectProperty and owl:Class from <cms:metadata type="composite"> or <cms:repeater">
-
- ?CLASS_URI ametys:class-node-embedded ?AMETYS_CLASS .
- # ?CONTAINER cms_:metadata ?AMETYS_CLASS .
- # ?AMETYS_CLASS ametysprops:type "composite" .
-
- :e e:optional {
- ?AMETYS_CLASS cms_:label [ rdf:value ?LABEL ] .
- ?CONTAINER cms_:label [ rdf:value ?LABEL_CONTAINER ] .
- ( ?LABEL " @ " ?LABEL_CONTAINER ) func:concat ?LABEL2 .
+ ?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER).
+ # _:t e:trace ( "?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER)" ?CLASS_URI ametys:class-node-embedded-parent (?AMETYS_CLASS ?CONTAINER) ).
+ _:e e:optional {
+ ?AMETYS_CLASS cms_:label [ rdf:value ?LABEL ] .
+ ?CONTAINER cms_:label [ rdf:value ?LABEL_CONTAINER ] .
+ ( ?LABEL " @ " ?LABEL_CONTAINER ) func:concat ?LABEL2 .
} .
- ?PARENT ?PROP_PARENT ?CONTAINER .
- (?PARENT "") ametys:get-content-type-root (?ROOT2 ?RELCLASS_OUTER ) .
- (?CONTAINER "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
+ _:f e:optional {
+ ?CONTAINER ametys:class-node-parent (?PARENT) .
+ (?PARENT "") ametys:get-content-type-root (?ROOT2 ?RELCLASS_OUTER ) .
+ # _:t e:trace ( "?ROOT2 ?RELCLASS_OUTER" ?ROOT2 ?RELCLASS_OUTER ).
+ } .
(?AMETYS_CLASS "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
-
+ # _:t e:trace (" ?ROOT ?PROP_URI" ?ROOT ?PROP_URI ).
(?PROP_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
} => {
?EMBEDED_CLASS a owl:Class ;
rdfs:label ?LABEL2 ;
ametys:label ?LABEL ;
- ametys:type "composite" ;
+ # ametys:type ?AMETYS_TYPE ;
ametys:embeddedIn ?RELCLASS_OUTER ;
rdfs:subClassOf ametys:Details .
?PROP_URI rdfs:range ?EMBEDED_CLASS .
?PROP_URI a owl:ObjectProperty ;
rdfs:label ?LABEL ;
- ametys:type "composite" .
+ # ametys:type ?AMETYS_TYPE ;
}.
# owl:ObjectProperty and range, directly within the cms_:content-type, or any embedding
-{ # ?CLASS cms_:content-type ?TYPE .
- # added:
+{
?PROP_URI ametys:property-node ?AMETYS_PROP .
-
?TYPE cms_:metadata ?AMETYS_PROP .
?CLASS ?PROP_PARENT ?TYPE .
- # (?CLASS ?AMETYS_PROP) ametys:makePropClassURI (?PROP_URI ?RELCLASS) .
?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
( ?CT_STRING0 "content-type." "" ) string:replace ?CT_STRING .
@@ -151,21 +147,14 @@
# owl:DatatypeProperty and range, directly within the cms_:content-type, or any embedding
{
- # ?CLASS cms_:content-type ?TYPE .
+ ?PROP_URI ametys:property-node ?AMETYS_PROP .
?CLASS ?PROP_PARENT ?TYPE .
- # added:
- ?PROP_URI ametys:property-node ?AMETYS_PROP .
-
?TYPE cms_:metadata ?AMETYS_PROP .
- # (?CLASS ?AMETYS_PROP) ametys:makePropClassURI (?PROP_URI ?XX) .
-
# require that cms_:metadata has no explicit contentType, so it's not an ObjectProperty
_:d e:findall( ?CT_STRING0 {
?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
} () ).
-
?AMETYS_PROP ametysprops:type ?DATATYPE0.
- # ?DATATYPE0 log:notEqualTo "composite" .
?DATATYPE0 ametys:makeDatatype ?DATATYPE .
} => {
?PROP_URI a owl:DatatypeProperty ;
@@ -176,38 +165,15 @@
# inner composite or repeater properties: set rdfs:domain
{
?CLASS_URI ametys:class-node-embedded ?CLASS .
- # ?CLASS ametysprops:type "composite" .
?CLASS cms_:metadata ?AMETYS_PROP .
-
(?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
- # (?CLASS "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
(?CLASS_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
} => {
?PROP_URI rdfs:domain ?EMBEDED_CLASS .
}.
-# inner repeater properties: set rdfs:domain
-#{
-# ?CLASS cms_:metadata ?AMETYS_PROP .
-# ?EMBEDING_CONTENTYPE cms_:repeater ?CLASS .
-# (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
-# (?CLASS "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
-# (?CLASS_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
-#} => {
-# ?PROP_URI rdfs:domain ?EMBEDED_CLASS .
-#}.
+
########### low level rules
-# { ?X cms_:label [ rdf:value ?LABEL ] .
-# } => {
-# ?X rdfs:label ?LABEL .
-# } .
-
-# cms_:description is always equal to cms_:label
-# { ?X cms_:description [ rdf:value ?LABEL ] .
-# } => {
- # ?X dc:description ?LABEL .
-# } .
-
# { ?X cms_:default-title [ rdf:value ?LABEL ] . } => { ?X rdfs:comment ?LABEL . } .
Modified: n3_nojs/ametys_content-type2owl_embedded.n3
===================================================================
--- n3_nojs/ametys_content-type2owl_embedded.n3 2016-07-02 17:20:51 UTC (rev 556)
+++ n3_nojs/ametys_content-type2owl_embedded.n3 2016-07-04 08:58:37 UTC (rev 557)
@@ -98,6 +98,8 @@
} => {
?CLASS_URI ametys:class-node ?TYPE .
?CLASS_URI ametys:class-node-embedded ?TYPE .
+ ?CLASS_URI ametys:class-node-embedded-parent (?TYPE ?CONTAINER).
+ ?CLASS_URI ametys:class-node-parent (?CONTAINER).
} .
{ ?CONTAINER cms_:repeater ?TYPE .
@@ -106,5 +108,7 @@
} => {
?CLASS_URI ametys:class-node ?TYPE .
?CLASS_URI ametys:class-node-embedded ?TYPE .
+ ?CLASS_URI ametys:class-node-embedded-parent (?TYPE ?CONTAINER).
+ ?CLASS_URI ametys:class-node-parent (?CONTAINER).
} .
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <jm...@us...> - 2016-07-02 17:20:53
|
Revision: 556
http://sourceforge.net/p/deductions/code/556
Author: jmvanel
Date: 2016-07-02 17:20:51 +0000 (Sat, 02 Jul 2016)
Log Message:
-----------
ametys_content-type2owl: BIG REFACTORING: TODO URI for embedding classes in rdfs:domain triples
Modified Paths:
--------------
n3_nojs/ametys_content-type2owl.n3
n3_nojs/ametys_content-type2owl.q.n3
n3_nojs/ametys_content-type2owl_embedded.n3
Modified: n3_nojs/ametys_content-type2owl.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.n3 2016-07-01 16:15:39 UTC (rev 555)
+++ n3_nojs/ametys_content-type2owl.n3 2016-07-02 17:20:51 UTC (rev 556)
@@ -129,55 +129,32 @@
# set correspondance between OWL URI & original Ametys node
{ # standard properties
- ?TYPE cms_:metadata ?AMETYS_PROP .
+ ?CLASS cms_:metadata ?AMETYS_PROP .
+ _:d e:findall( ?AT {?AMETYS_PROP ametysprops:type ?AT . ?AT log:equalTo "composite" .} () ).
(?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
} => {
?PROP_URI ametys:property-node ?AMETYS_PROP .
}.
-
-{ # inner composite properties
- # ?CLASS cms_:metadata ?AMETYS_PROP .
- # (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
-
- ?CLASS ametysprops:type "composite" .
-} => {
- ?PROP_URI
- ametys:type "composite-inner"
- # ; ametys:property-node ?AMETYS_PROP .
-}.
-
-
-{ # inner repeater properties: set correspondance between property URI & original Ametys node
- ?EMBEDING_CONTENTYPE cms_:repeater ?CLASS .
- ?CLASS cms_:metadata ?AMETYS_PROP .
-
- (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
-} => {
- ?PROP_URI
- ametys:type "repeater-inner"
- # ; ametys:property-node ?AMETYS_PROP .
-}.
-
########### structural rules: classes
-{ ?CLASS cms_:content-type ?TYPE .
- (?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS )
+{ ?ROOT cms_:content-type ?TYPE .
+ (?TYPE "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI )
} => {
- ?RELCLASS ametys:class-node ?TYPE .
+ ?CLASS_URI ametys:class-node ?TYPE .
}.
########### structural rules: infer model-node
-{ # WIP: factor common stuff to property Ametys nodes (XML elements cms:metadata)
- ?PROP_URI ametys:property-node ?AMETYS_NODE .
+{ # factor common stuff to property Ametys nodes (XML elements cms:metadata)
+ ?PROP_URI ametys:property-node ?AMETYS_PROP_NODE .
} => {
- ?PROP_URI ametys:model-node ?AMETYS_NODE .
+ ?PROP_URI ametys:model-node ?AMETYS_PROP_NODE .
} .
-{ # WIP: factor common stuff to class Ametys nodes (XML elements cms:metadata composite, cms:repeater, cms:content-type)
+{ # factor common stuff to class Ametys nodes (XML elements cms:metadata composite, cms:repeater, cms:content-type)
?CLASS_URI ametys:class-node ?AMETYS_CLASS .
} => {
?CLASS_URI ametys:model-node ?AMETYS_CLASS .
Modified: n3_nojs/ametys_content-type2owl.q.n3
===================================================================
--- n3_nojs/ametys_content-type2owl.q.n3 2016-07-01 16:15:39 UTC (rev 555)
+++ n3_nojs/ametys_content-type2owl.q.n3 2016-07-02 17:20:51 UTC (rev 556)
@@ -42,10 +42,6 @@
# create raw Ametys classes with possibly inheritance
-
-# REFACTORING: consequent: ?RELCLASS ametys:class-node ?TYPE .
-# TODO REFACTORING: move subClassOf in another rule
-# with this in antecedent: ?URI ametys:model-node ?AMETYS_NODE .
{ ?CLASS cms_:content-type ?TYPE .
_:dd e:optional {
@@ -55,25 +51,16 @@
( ?SUPERCLASS_STRING0 "content-type." "" ) string:replace ?SUPERCLASS_STRING .
?SUPERCLASS_STRING ametys:label2resource ?SUPERCLASS .
} .
-
- # _:e e:optional { ?TYPE cms_:label [ rdf:value ?LABEL ] . } .
- # _:e e:optional { ?TYPE cms_:description [ rdf:value ?DESCRIPTION ] .
- # ?DESCRIPTION log:notEqualTo ?LABEL } .
-
_:e e:optional { ?TYPE cms_:category [ rdf:value ?CATEGORY ] . } .
_:e e:optional { ?TYPE ametysprops:abstract ?ABSTRACT . } .
- # ?CLASS ametys:makeRelativeURI-Class ?RELCLASS .
(?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS )
} => {
?RELCLASS a owl:Class ;
rdfs:subClassOf ?SUPERCLASS;
ametys:subClassOf ?SUPERCLASS_STRING ;
ametys:abstract ?ABSTRACT ;
- # ametys:description ?DESCRIPTION ;
- ametys:category ?CATEGORY ;
- # rdfs:label ?LABEL
- .
+ ametys:category ?CATEGORY .
} .
########### rules for creating documentation: rdfs:label, etc
@@ -93,44 +80,34 @@
########### rules for CMS properties
# any Property: set rdfs:domain
-# REFACTORING: removed ?CLASS cms_:content-type ?TYPE .
-# TODO REFACTORING: move ametys:name in another rule
-# with this in antecedent: ?URI ametys:model-node ?AMETYS_NODE .
-{ # ?CLASS cms_:content-type ?TYPE .
+
+{
+ ?PROP_URI ametys:property-node ?AMETYS_PROP .
+ # TODO: when the TYPE is embedded, the URI different with #class
?TYPE cms_:metadata ?AMETYS_PROP .
(?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
- (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
-
- # _:e e:optional { ?AMETYS_PROP cms_:label [ rdf:value ?LABEL ] . } .
- # _:e e:optional { ?AMETYS_PROP ametysprops:label [ rdf:value ?LABEL ] . } .
- # _:e e:optional { ?TYPE cms_:description [ rdf:value ?DESCRIPTION ] . ?DESCRIPTION log:notEqualTo ?LABEL } .
-
- ?AMETYS_PROP ametysprops:name ?PROPNAME .
+ _:e e:optional { ?AMETYS_PROP ametysprops:name ?PROPNAME . } .
} => {
?PROP_URI
rdfs:domain ?RELCLASS ;
- # rdfs:label ?LABEL ;
- # ametys:description ?DESCRIPTION ;
ametys:name ?PROPNAME .
}.
-{ # owl:ObjectProperty and owl:Class from <cms:metadata type="composite">
- # TODO: rename ?AMETYS_PROP to ?AMETYS_CLASS
- ?TYPE cms_:metadata ?AMETYS_PROP .
- ?AMETYS_PROP ametysprops:type "composite" .
+{ # owl:ObjectProperty and owl:Class from <cms:metadata type="composite"> or <cms:repeater">
- _:e e:optional {
- ?AMETYS_PROP cms_:label [ rdf:value ?LABEL ] .
- ?TYPE cms_:label [ rdf:value ?LABEL_TYPE ] .
- ( ?LABEL " @ " ?LABEL_TYPE ) func:concat ?LABEL2 .
+ ?CLASS_URI ametys:class-node-embedded ?AMETYS_CLASS .
+ # ?CONTAINER cms_:metadata ?AMETYS_CLASS .
+ # ?AMETYS_CLASS ametysprops:type "composite" .
+
+ :e e:optional {
+ ?AMETYS_CLASS cms_:label [ rdf:value ?LABEL ] .
+ ?CONTAINER cms_:label [ rdf:value ?LABEL_CONTAINER ] .
+ ( ?LABEL " @ " ?LABEL_CONTAINER ) func:concat ?LABEL2 .
} .
- # _:e e:optional { ?TYPE cms_:description [ rdf:value ?DESCRIPTION ] .
- # ?DESCRIPTION log:notEqualTo ?LABEL } .
-
- ?PARENT ?PROP_PARENT ?TYPE .
+ ?PARENT ?PROP_PARENT ?CONTAINER .
(?PARENT "") ametys:get-content-type-root (?ROOT2 ?RELCLASS_OUTER ) .
- (?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
- (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
+ (?CONTAINER "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
+ (?AMETYS_CLASS "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
(?PROP_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
} => {
@@ -144,56 +121,18 @@
?PROP_URI rdfs:range ?EMBEDED_CLASS .
?PROP_URI a owl:ObjectProperty ;
rdfs:label ?LABEL ;
- # ametys:description ?DESCRIPTION ;
ametys:type "composite" .
}.
-{ # owl:ObjectProperty and owl:Class from <cms:repeater">
-# TODO REFACTORING: new rule (allows to treat similarly composite & repeater sub-forms):
-# { ?TYPE cms_:repeater ?AMETYS_PROP . } => { ?TYPE ametysprops:type "repeater" }.
-# then this rule will become:
-# { ?TYPE ametysprops:type ?EMBEDDING_TYPE. Same_Triples } => { Same_Triples } .
- ?TYPE cms_:repeater ?AMETYS_PROP .
+# owl:ObjectProperty and range, directly within the cms_:content-type, or any embedding
+{ # ?CLASS cms_:content-type ?TYPE .
+ # added:
+ ?PROP_URI ametys:property-node ?AMETYS_PROP .
- _:e e:optional {
- ?AMETYS_PROP cms_:label [ rdf:value ?LABEL ] .
- ?TYPE cms_:label [ rdf:value ?LABEL_TYPE ] .
- ( ?LABEL " @ " ?LABEL_TYPE ) func:concat ?LABEL2 .
- } .
- # _:e e:optional { ?TYPE cms_:description [ rdf:value ?DESCRIPTION ] .
- # ?DESCRIPTION log:notEqualTo ?LABEL } .
-
- # PASTED from "composite" rule above
- ?PARENT ?PROP_PARENT ?TYPE .
- (?PARENT "") ametys:get-content-type-root (?ROOT2 ?RELCLASS_OUTER ) .
- (?TYPE "") ametys:get-content-type-root ( ?ROOT ?RELCLASS ) .
- (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
-
- (?PROP_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
-} => {
- ?EMBEDED_CLASS a owl:Class ;
- rdfs:label ?LABEL2 ;
- ametys:label ?LABEL ;
- ametys:type "repeater" ;
- ametys:embeddedIn ?RELCLASS_OUTER ;
- rdfs:subClassOf ametys:Details .
-
- ?PROP_URI rdfs:range ?EMBEDED_CLASS .
- ?PROP_URI a owl:ObjectProperty ;
- rdfs:label ?LABEL ;
- # ametys:description ?DESCRIPTION ;
- ametys:type "repeater" .
-}.
-
-
-# owl:ObjectProperty directly within the cms_:content-type
-# TODO REFACTORING : just this in consequent:
-# ?PROP_URI ametys:property-node ?AMETYS_PROP .
-# TODO REFACTORING : there are 3 rules computing the rdfs:range from the ametysprops:contentType
-{ ?CLASS cms_:content-type ?TYPE .
?TYPE cms_:metadata ?AMETYS_PROP .
- (?CLASS ?AMETYS_PROP) ametys:makePropClassURI (?PROP_URI ?RELCLASS) .
+ ?CLASS ?PROP_PARENT ?TYPE .
+ # (?CLASS ?AMETYS_PROP) ametys:makePropClassURI (?PROP_URI ?RELCLASS) .
?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
( ?CT_STRING0 "content-type." "" ) string:replace ?CT_STRING .
@@ -210,132 +149,53 @@
ametys:multiple ?MULTIPLE .
}.
-{ # owl:ObjectProperty composite-inner : range
-
-# TODO REFACTORING : there are 3 rules computing the rdfs:range from the ametysprops:contentType
- ?PROP_URI ametys:type "composite-inner" .
- ?PROP_URI ametys:property-node ?AMETYS_PROP .
-
- ?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
- ( ?CT_STRING0 "content-type." "" ) string:replace ?CT_STRING .
- _:d e:optional { ?CT_STRING ametys:label2resource ?CT } .
-
- # _:e e:optional { ?AMETYS_PROP cms_:label [ rdf:value ?LABEL ] . } .
- # _:e e:optional { ?AMETYS_PROP cms_:description [ rdf:value ?DESCRIPTION ] . ?DESCRIPTION log:notEqualTo ?LABEL } .
-} => {
- ?PROP_URI a owl:ObjectProperty ;
- rdfs:range ?CT ;
- # rdfs:label ?LABEL ;
- # ametys:description ?DESCRIPTION ;
- ametys:range ?CT_STRING .
-}.
-
-# owl:ObjectProperty repeater-inner : range
-
-# TODO REFACTORING : there 3 rules computing the rdfs:range from the ametysprops:contentType
+# owl:DatatypeProperty and range, directly within the cms_:content-type, or any embedding
{
- ?PROP_URI ametys:type "repeater-inner" .
- ?PROP_URI ametys:property-node ?AMETYS_PROP .
+ # ?CLASS cms_:content-type ?TYPE .
+ ?CLASS ?PROP_PARENT ?TYPE .
+ # added:
+ ?PROP_URI ametys:property-node ?AMETYS_PROP .
- ?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
- ( ?CT_STRING0 "content-type." "" ) string:replace ?CT_STRING .
- _:d e:optional { ?CT_STRING ametys:label2resource ?CT } .
+ ?TYPE cms_:metadata ?AMETYS_PROP .
+ # (?CLASS ?AMETYS_PROP) ametys:makePropClassURI (?PROP_URI ?XX) .
- # _:e e:optional { ?AMETYS_PROP cms_:label [ rdf:value ?LABEL ] . } .
- # _:e e:optional { ?AMETYS_PROP cms_:description [ rdf:value ?DESCRIPTION ] . ?DESCRIPTION log:notEqualTo ?LABEL } .
-} => {
- ?PROP_URI a owl:ObjectProperty ;
- rdfs:range ?CT ;
- # rdfs:label ?LABEL ;
- # ametys:description ?DESCRIPTION ;
- ametys:range ?CT_STRING .
-}.
-
-
-# owl:DatatypeProperty directly within the cms_:content-type
-# TODO REFACTORING : just this in consequent:
-# ?PROP_URI ametys:property-node ?AMETYS_PROP .
-{
- ?CLASS cms_:content-type ?TYPE .
- ?TYPE cms_:metadata ?AMETYS_PROP .
- (?CLASS ?AMETYS_PROP) ametys:makePropClassURI (?PROP_URI ?XX) .
-
# require that cms_:metadata has no explicit contentType, so it's not an ObjectProperty
_:d e:findall( ?CT_STRING0 {
?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
} () ).
?AMETYS_PROP ametysprops:type ?DATATYPE0.
- ?DATATYPE0 log:notEqualTo "composite" .
+ # ?DATATYPE0 log:notEqualTo "composite" .
?DATATYPE0 ametys:makeDatatype ?DATATYPE .
} => {
?PROP_URI a owl:DatatypeProperty ;
rdfs:range ?DATATYPE .
}.
-# owl:DatatypeProperty composite-inner : range
-{
- ?PROP_URI ametys:type "composite-inner" .
- ?PROP_URI ametys:property-node ?AMETYS_PROP .
- # require that cms_:metadata has no explicit contentType, so it's not an ObjectProperty
- _:d e:findall( ?CT_STRING0 {
- ?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
- } () ).
- ?AMETYS_PROP ametysprops:type ?DATATYPE0.
- ?DATATYPE0 log:notEqualTo "composite" .
- ?DATATYPE0 ametys:makeDatatype ?DATATYPE .
- # _:e e:optional { ?AMETYS_PROP cms_:label [ rdf:value ?LABEL ] . } .
- # _:e e:optional { ?AMETYS_PROP cms_:description [ rdf:value ?DESCRIPTION ] . ?DESCRIPTION log:notEqualTo ?LABEL } .
-} => {
- ?PROP_URI a owl:DatatypeProperty ;
- # rdfs:label ?LABEL ;
- # ametys:description ?DESCRIPTION ;
- rdfs:range ?DATATYPE .
-}.
-# owl:DatatypeProperty repeater-inner : range
+# inner composite or repeater properties: set rdfs:domain
{
- ?PROP_URI ametys:type "repeater-inner" .
- ?PROP_URI ametys:property-node ?AMETYS_PROP .
- # require that cms_:metadata has no explicit contentType, so it's not an ObjectProperty
- _:d e:findall( ?CT_STRING0 {
- ?AMETYS_PROP ametysprops:contentType ?CT_STRING0 .
- } () ).
-
- ?AMETYS_PROP ametysprops:type ?DATATYPE0.
- ?DATATYPE0 log:notEqualTo "composite" .
- ?DATATYPE0 ametys:makeDatatype ?DATATYPE .
- # _:e e:optional { ?AMETYS_PROP cms_:label [ rdf:value ?LABEL ] . } .
- # _:e e:optional { ?AMETYS_PROP cms_:description [ rdf:value ?DESCRIPTION ] . ?DESCRIPTION log:notEqualTo ?LABEL } .
-} => {
- ?PROP_URI a owl:DatatypeProperty ;
- # rdfs:label ?LABEL ;
- # ametys:description ?DESCRIPTION ;
- rdfs:range ?DATATYPE .
-}.
-
-# inner composite properties: set rdfs:domain
-{ ?CLASS ametysprops:type "composite" .
+ ?CLASS_URI ametys:class-node-embedded ?CLASS .
+ # ?CLASS ametysprops:type "composite" .
?CLASS cms_:metadata ?AMETYS_PROP .
(?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
- (?CLASS "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
+ # (?CLASS "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
(?CLASS_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
} => {
?PROP_URI rdfs:domain ?EMBEDED_CLASS .
}.
# inner repeater properties: set rdfs:domain
-{
- ?CLASS cms_:metadata ?AMETYS_PROP .
- ?EMBEDING_CONTENTYPE cms_:repeater ?CLASS .
-
- (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
- (?CLASS "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
- (?CLASS_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
-} => {
- ?PROP_URI rdfs:domain ?EMBEDED_CLASS .
-}.
+#{
+# ?CLASS cms_:metadata ?AMETYS_PROP .
+# ?EMBEDING_CONTENTYPE cms_:repeater ?CLASS .
+# (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?PROP_URI ) .
+# (?CLASS "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
+# (?CLASS_URI "#class") ametys:relativizeURIstring ?EMBEDED_CLASS.
+#} => {
+# ?PROP_URI rdfs:domain ?EMBEDED_CLASS .
+#}.
########### low level rules
# { ?X cms_:label [ rdf:value ?LABEL ] .
Modified: n3_nojs/ametys_content-type2owl_embedded.n3
===================================================================
--- n3_nojs/ametys_content-type2owl_embedded.n3 2016-07-01 16:15:39 UTC (rev 555)
+++ n3_nojs/ametys_content-type2owl_embedded.n3 2016-07-02 17:20:51 UTC (rev 556)
@@ -32,18 +32,7 @@
?S ametys:makeRelativeURI ?REL .
} .
-{
- # CONTAINER of current type (AMETYS_PROP); can be a cms:content-type or a cms:repeater or a composite
- ?CONTAINER cms_:metadata ?AMETYS_PROP .
- ?AMETYS_PROP ametysprops:type "composite" .
- (?AMETYS_PROP "") ametys:get-content-type-root ( ?ROOT ?IDENTIFIER_URI )
-} => {
-# WIP TODO
- # ?IDENTIFIER_URI ametys:type "composite-inner" ; ametys:class-node ?AMETYS_PROP .
- # ?IDENTIFIER_URI ametys:container ?CONTAINER .
-} .
-
{ # get content-type root and accumulate (relative) URI : terminate recursion
(?ELEM ?IDENTIFIER) ametys:get-content-type-root ( ?ROOT ?IDENTIFIER_URI )
} <= {
@@ -90,6 +79,8 @@
} .
} .
+########### structural rules
+
{ # assign a ametysprops:name to a :content-type , like embedded types have
?CLASS cms_:content-type ?TYPE .
?CLASS ametys:makeRelativeURIString ?IDENTIFIER .
@@ -97,3 +88,23 @@
} => {
?TYPE ametysprops:name ?IDENTIFIER .
} .
+
+########### structural rules: classes
+
+{ ?CONTAINER cms_:metadata ?TYPE .
+ ?TYPE ametysprops:type "composite" .
+ (?TYPE "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
+ # _:e e:trace ("composite" ?CLASS_URI ).
+} => {
+ ?CLASS_URI ametys:class-node ?TYPE .
+ ?CLASS_URI ametys:class-node-embedded ?TYPE .
+} .
+
+{ ?CONTAINER cms_:repeater ?TYPE .
+ (?TYPE "") ametys:get-content-type-root ( ?ROOT ?CLASS_URI ) .
+ # _:e e:trace ("repeater" ?CLASS_URI ).
+} => {
+ ?CLASS_URI ametys:class-node ?TYPE .
+ ?CLASS_URI ametys:class-node-embedded ?TYPE .
+} .
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|