Skip to content
Snippets Groups Projects
Commit 05cb77e2 authored by Aurélien Lamercerie's avatar Aurélien Lamercerie
Browse files

New rule to deduce a relation from restriction (4)

parent 7b7b5731
Branches
No related tags found
No related merge requests found
...@@ -47,20 +47,26 @@ def __search_structure(graph): ...@@ -47,20 +47,26 @@ def __search_structure(graph):
return result_set return result_set
def __search_individual_from_class(graph, class_net): def __search_individual_from_class(graph, class_net_uri):
select_data_list = ['?individual_net'] select_data_list = ['?individual_net']
clause_list = [ clause_list = [
'?individual_net a net:Individual_Net.', '?individual_net a net:Individual_Net.',
f'?individual_net net:hasMotherClassNet <{class_net}>.' f'?individual_net net:hasMotherClassNet <{class_net_uri}>.'
] ]
query_code = generate_select_query(graph, select_data_list, clause_list) query_code = generate_select_query(graph, select_data_list, clause_list)
result_set = graph.query(query_code) result_set = graph.query(query_code)
return result_set return result_set
def __search_subclass_of_class(graph, class_net): def __search_subclass_of_class_net(graph, class_net_uri):
# To be defined select_data_list = ['?subclass_net']
pass clause_list = [
f'?subclass_net net:hasMotherClassNet* <{class_net_uri}>.'
]
query_code = generate_select_query(graph, select_data_list, clause_list)
result_set = graph.query(query_code)
return result_set
#============================================================================== #==============================================================================
# Useful Computation Method(s) # Useful Computation Method(s)
...@@ -101,16 +107,27 @@ def __construct_individual_net(graph, mother_class_net): ...@@ -101,16 +107,27 @@ def __construct_individual_net(graph, mother_class_net):
# -- Net Composition # -- Net Composition
individual_net = net.IndividualNet(graph) individual_net = net.IndividualNet(graph)
# -- Main mother class
main_mother_class_net = mother_class_net
if mother_class_net.mother_class_net:
main_mother_class_net = net.ClassNet(graph, uri=mother_class_net.mother_class_net[0])
# -- Data Computation # -- Data Computation
individual_net.base_node = mother_class_net.base_node individual_net.base_node = mother_class_net.base_node
individual_net.node = mother_class_net.node individual_net.node = mother_class_net.node
individual_net.individual_label = __define_individual_label(mother_class_net) individual_net.individual_label = __define_individual_label(main_mother_class_net)
individual_net.mother_class_net = mother_class_net.uri
structure_ref = __get_structure(graph) structure_ref = __get_structure(graph)
individual_net.structure = structure_ref individual_net.structure = structure_ref
# -- Mother classes
mother_class_net_list = [mother_class_net.uri]
subclass_net_set = __search_subclass_of_class_net(graph, mother_class_net.uri)
for row in subclass_net_set:
mother_class_net_list.append(row.subclass_net)
individual_net.mother_class_net = mother_class_net_list
# -- Net Naming # -- Net Naming
individual_net.naming = define_individual_naming(mother_class_net, structure_ref) individual_net.naming = define_individual_naming(main_mother_class_net, structure_ref)
# -- Relation Propagation # -- Relation Propagation
# __propagate_relation(graph, individual_net, base_leaf) # __propagate_relation(graph, individual_net, base_leaf)
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#============================================================================== #==============================================================================
from rdflib import URIRef from rdflib import URIRef
from transduction import net
#============================================================================== #==============================================================================
......
...@@ -471,37 +471,6 @@ net:axiom_disjointProperty_not-direct_direct_d2 a net:Axiom_Net ; ...@@ -471,37 +471,6 @@ net:axiom_disjointProperty_not-direct_direct_d2 a net:Axiom_Net ;
net:compositeProperty_not-direct_d2 ; net:compositeProperty_not-direct_d2 ;
net:hasStructure "SSC-01-01" . net:hasStructure "SSC-01-01" .
net:compositeClass_object-orbit-hasManner-direct-sun_o a net:Composite_Class_Net ;
net:composeFrom net:atomClass_object_o,
net:atomClass_sun_s2,
net:compositeProperty_orbit-hasManner-direct_o2 ;
net:coverBaseNode :leaf_object_o ;
net:coverNode :leaf_direct-02_d,
:leaf_direct-02_d2,
:leaf_hasManner_m9,
:leaf_object_o,
:leaf_orbit-01_o2,
:leaf_sun_s2 ;
net:hasMotherClassNet net:atomClass_object_o ;
net:hasNaming "object-orbit-hasManner-direct-sun" ;
net:hasRestriction net:restriction_orbit-hasManner-direct-sun_o2 ;
net:hasStructure "SSC-01-01" .
net:compositeClass_object-orbit-hasManner-not-direct-sun_o a net:Composite_Class_Net ;
net:composeFrom net:atomClass_object_o,
net:atomClass_sun_s2,
net:compositeProperty_orbit-hasManner-not-direct_o2 ;
net:coverBaseNode :leaf_object_o ;
net:coverNode :leaf_direct-02_d2,
:leaf_hasManner_m9,
:leaf_object_o,
:leaf_orbit-01_o2,
:leaf_sun_s2 ;
net:hasMotherClassNet net:atomClass_object_o ;
net:hasNaming "object-orbit-hasManner-not-direct-sun" ;
net:hasRestriction net:restriction_orbit-hasManner-not-direct-sun_o2 ;
net:hasStructure "SSC-01-01" .
net:entityClass a owl:AnnotationProperty ; net:entityClass a owl:AnnotationProperty ;
rdfs:label "entity class" ; rdfs:label "entity class" ;
rdfs:subPropertyOf net:objectValue . rdfs:subPropertyOf net:objectValue .
...@@ -653,20 +622,20 @@ net:relation_SolarSystem-hasPart-sun-SSC-01-01_p a net:Relation_Net ; ...@@ -653,20 +622,20 @@ net:relation_SolarSystem-hasPart-sun-SSC-01-01_p a net:Relation_Net ;
net:hasStructure "SSC-01-01" ; net:hasStructure "SSC-01-01" ;
net:hasSubjectNet net:individual_SolarSystem_p . net:hasSubjectNet net:individual_SolarSystem_p .
net:relation_gravitation-bind-system-SSC-01-01-bind-SolarSystem_g a net:Relation_Net ; net:relation_gravitation-SSC-01-01-bind-SolarSystem_g a net:Relation_Net ;
net:composeFrom net:atomProperty_bind_b, net:composeFrom net:atomProperty_bind_b,
net:individual_SolarSystem_p, net:individual_SolarSystem_p,
net:individual_gravitation-bind-system-SSC-01-01_g ; net:individual_gravitation-SSC-01-01_g ;
net:coverBaseNode :leaf_gravitation_g ; net:coverBaseNode :leaf_gravitation_g ;
net:coverNode :leaf_bind-01_b, net:coverNode :leaf_bind-01_b,
:leaf_gravitation_g, :leaf_gravitation_g,
:leaf_system_p, :leaf_system_p,
:leaf_system_s ; :leaf_system_s ;
net:hasNaming "gravitation-bind-system-SSC-01-01-bind-SolarSystem" ; net:hasNaming "gravitation-SSC-01-01-bind-SolarSystem" ;
net:hasObjectNet net:individual_SolarSystem_p ; net:hasObjectNet net:individual_SolarSystem_p ;
net:hasPredicateNet net:atomProperty_bind_b ; net:hasPredicateNet net:atomProperty_bind_b ;
net:hasStructure "SSC-01-01" ; net:hasStructure "SSC-01-01" ;
net:hasSubjectNet net:individual_gravitation-bind-system-SSC-01-01_g . net:hasSubjectNet net:individual_gravitation-SSC-01-01_g .
net:type a owl:AnnotationProperty ; net:type a owl:AnnotationProperty ;
rdfs:label "type "@fr ; rdfs:label "type "@fr ;
...@@ -857,6 +826,37 @@ net:compositeClass_gravitation-bind-system_g a net:Composite_Class_Net ; ...@@ -857,6 +826,37 @@ net:compositeClass_gravitation-bind-system_g a net:Composite_Class_Net ;
net:hasRestriction net:restriction_bind-system_b ; net:hasRestriction net:restriction_bind-system_b ;
net:hasStructure "SSC-01-01" . net:hasStructure "SSC-01-01" .
net:compositeClass_object-orbit-hasManner-direct-sun_o a net:Composite_Class_Net ;
net:composeFrom net:atomClass_object_o,
net:atomClass_sun_s2,
net:compositeProperty_orbit-hasManner-direct_o2 ;
net:coverBaseNode :leaf_object_o ;
net:coverNode :leaf_direct-02_d,
:leaf_direct-02_d2,
:leaf_hasManner_m9,
:leaf_object_o,
:leaf_orbit-01_o2,
:leaf_sun_s2 ;
net:hasMotherClassNet net:atomClass_object_o ;
net:hasNaming "object-orbit-hasManner-direct-sun" ;
net:hasRestriction net:restriction_orbit-hasManner-direct-sun_o2 ;
net:hasStructure "SSC-01-01" .
net:compositeClass_object-orbit-hasManner-not-direct-sun_o a net:Composite_Class_Net ;
net:composeFrom net:atomClass_object_o,
net:atomClass_sun_s2,
net:compositeProperty_orbit-hasManner-not-direct_o2 ;
net:coverBaseNode :leaf_object_o ;
net:coverNode :leaf_direct-02_d2,
:leaf_hasManner_m9,
:leaf_object_o,
:leaf_orbit-01_o2,
:leaf_sun_s2 ;
net:hasMotherClassNet net:atomClass_object_o ;
net:hasNaming "object-orbit-hasManner-not-direct-sun" ;
net:hasRestriction net:restriction_orbit-hasManner-not-direct-sun_o2 ;
net:hasStructure "SSC-01-01" .
net:compositeClass_system-hasPart-object_s a net:Class_Net, net:compositeClass_system-hasPart-object_s a net:Class_Net,
net:Composite_Class_Net ; net:Composite_Class_Net ;
:role_domain net:atomClass_system_p, :role_domain net:atomClass_system_p,
...@@ -1129,21 +1129,23 @@ net:Property_Net a owl:Class ; ...@@ -1129,21 +1129,23 @@ net:Property_Net a owl:Class ;
net:Value_Net a owl:Class ; net:Value_Net a owl:Class ;
rdfs:subClassOf net:Net . rdfs:subClassOf net:Net .
net:individual_gravitation-bind-system-SSC-01-01_g a net:Individual_Net ; net:individual_gravitation-SSC-01-01_g a net:Individual_Net ;
net:coverBaseNode :leaf_gravitation_g ; net:coverBaseNode :leaf_gravitation_g ;
net:coverNode :leaf_bind-01_b, net:coverNode :leaf_bind-01_b,
:leaf_gravitation_g, :leaf_gravitation_g,
:leaf_system_s ; :leaf_system_s ;
net:hasIndividualLabel "any gravitation-bind-system" ; net:hasIndividualLabel "any gravitation" ;
net:hasMotherClassNet net:compositeClass_gravitation-bind-system_g ; net:hasMotherClassNet net:compositeClass_gravitation-bind-system_g ;
net:hasNaming "gravitation-bind-system-SSC-01-01" ; net:hasNaming "gravitation-SSC-01-01" ;
net:hasStructure "SSC-01-01" . net:hasStructure "SSC-01-01" .
net:individual_object-SSC-01-01_o a net:Individual_Net ; net:individual_object-SSC-01-01_o a net:Individual_Net ;
net:coverBaseNode :leaf_object_o ; net:coverBaseNode :leaf_object_o ;
net:coverNode :leaf_object_o ; net:coverNode :leaf_object_o ;
net:hasIndividualLabel "any object" ; net:hasIndividualLabel "any object" ;
net:hasMotherClassNet net:atomClass_object_o ; net:hasMotherClassNet net:atomClass_object_o,
net:compositeClass_object-orbit-hasManner-direct-sun_o,
net:compositeClass_object-orbit-hasManner-not-direct-sun_o ;
net:hasNaming "object-SSC-01-01" ; net:hasNaming "object-SSC-01-01" ;
net:hasStructure "SSC-01-01" . net:hasStructure "SSC-01-01" .
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment