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

Update Net Builders (and CTS using builders for atomic extraction)

parent 234a74a8
Branches
Tags
No related merge requests found
...@@ -30,20 +30,14 @@ rule_set = {} ...@@ -30,20 +30,14 @@ rule_set = {}
rule_set['create-atom-class-net'] = { rule_set['create-atom-class-net'] = {
'label': "create-atom-class-net", 'label': "create-atom-class-net",
'comment': "Create Atom Class Net from AMR Term Concept", 'comment': "Create Atom Class Net from AMR Term Concept",
'construction': """ 'construction': f"""
# -- New Class Net {atom_class_net.construct(base_node='?leaf1',
?newNet a net:Atom_Class_Net ; structure='?sentenceRef',
net:hasStructure ?sentenceRef ; class_name='?conceptName')}
net:coverBaseNode ?leaf1 ;
net:hasClassName ?conceptName.
# -- Propagation of relations (from nodes to nets) {atom_class_net.propagate_relations()}
?inRelationRole a net:Relation.
?inNet ?inRelationRole ?newNet.
?outRelationRole a net:Relation.
?newNet ?outRelationRole ?outNet.
""", """,
'clause': """ 'clause': f"""
# -- Identify Class covering a single leaf # -- Identify Class covering a single leaf
?leaf1 a amr:AMR_Leaf ; ?leaf1 a amr:AMR_Leaf ;
amr:hasConcept ?leaf1Concept ; amr:hasConcept ?leaf1Concept ;
...@@ -56,24 +50,10 @@ rule_set['create-atom-class-net'] = { ...@@ -56,24 +50,10 @@ rule_set['create-atom-class-net'] = {
?root a amr:AMR_Root ; ?root a amr:AMR_Root ;
amr:hasSentenceID ?sentenceRef. amr:hasSentenceID ?sentenceRef.
# -- Identify inbound relations linked to the base leaf (for propagation) {atom_class_net.identify_relations_for_propagation('?leaf1')}
OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?inLeaf.
?inLeaf ?inRelationEdge ?leaf1.
?inRelationEdge amr:hasAmrRole ?inRelationRole.}
# -- Identify outgoing relations linked to the base leaf (for propagation)
OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?outLeaf.
?leaf1 ?outRelationEdge ?outLeaf.
?outRelationEdge amr:hasAmrRole ?outRelationRole.}
""", """,
'binding': """ 'binding': f"""
# -- New Class Net {atom_class_net.bind_uri('?conceptName', '?varLabel')}
BIND (CONCAT(str(net:), 'atomClass') AS ?n1).
BIND (CONCAT(?n1, '_', ?conceptName) AS ?n2).
BIND (CONCAT(?n2, '_', ?varLabel) AS ?n3).
BIND (uri(?n3) AS ?newNet).
""" """
} }
...@@ -87,28 +67,22 @@ rule_set['create-individual-net-1'] = { ...@@ -87,28 +67,22 @@ rule_set['create-individual-net-1'] = {
'comment': ("Create Individual Net from AMR Leaf: ", 'comment': ("Create Individual Net from AMR Leaf: ",
" (1) with variable corresponding to a named entity ", " (1) with variable corresponding to a named entity ",
" (2) without link to domain edge"), " (2) without link to domain edge"),
'construction': """ 'construction': f"""
# -- New Individual Net {individual_net.construct(base_node='?baseLeaf',
?newNet a net:Individual_Net ; structure='?sentenceRef',
net:hasStructure ?sentenceRef ; mother_class_net='?classNet',
net:coverBaseNode ?baseLeaf ; individual_label='?valueLabel')}
net:hasMotherClassNet ?classNet ;
net:hasIndividualLabel ?valueLabel. {individual_net.propagate_relations()}
# -- Propagation of relations (from nodes to nets)
?inRelationRole a net:Relation.
?inNet ?inRelationRole ?newNet.
?outRelationRole a net:Relation.
?newNet ?outRelationRole ?outNet.
""", """,
'clause': """ 'clause': f"""
# -- Identify name relation between a leaf and a value # -- Identify name relation between a leaf and a value
?baseLeaf a amr:AMR_Leaf ; ?baseLeaf a amr:AMR_Leaf ;
amr:hasConcept ?concept ; amr:hasConcept ?concept ;
amr:hasVariable ?variable. amr:hasVariable ?variable.
?baseLeaf ?edge ?value. ?baseLeaf ?edge ?value.
?edge amr:hasRoleID ?roleID. ?edge amr:hasRoleID ?roleID.
VALUES ?roleID {'name'} VALUES ?roleID {{'name'}}
?value a amr:AMR_Value ; ?value a amr:AMR_Value ;
rdfs:label ?valueLabel. rdfs:label ?valueLabel.
?classNet a [rdfs:subClassOf* net:Class_Net] ; ?classNet a [rdfs:subClassOf* net:Class_Net] ;
...@@ -119,89 +93,13 @@ rule_set['create-individual-net-1'] = { ...@@ -119,89 +93,13 @@ rule_set['create-individual-net-1'] = {
?root a amr:AMR_Root ; ?root a amr:AMR_Root ;
amr:hasSentenceID ?sentenceRef. amr:hasSentenceID ?sentenceRef.
# -- Identify inbound relations linked to the base leaf (for propagation) {individual_net.identify_relations_for_propagation('?baseLeaf')}
OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?inLeaf.
?inLeaf ?inRelationEdge ?baseLeaf.
?inRelationEdge amr:hasAmrRole ?inRelationRole.}
# -- Identify outgoing relations linked to the base leaf (for propagation)
OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?outLeaf.
?baseLeaf ?outRelationEdge ?outLeaf.
?outRelationEdge amr:hasAmrRole ?outRelationRole.}
""", """,
'binding': """ 'binding': f"""
# -- New Individual Net {individual_net.bind_uri('?conceptName', '?valueLabel')}
BIND (REPLACE(?valueLabel, ' ', "") AS ?valueRef).
BIND (CONCAT(str(net:), 'individual') AS ?n1).
BIND (CONCAT(?n1, '_', ?conceptName) AS ?n2).
BIND (CONCAT(?n2, '_', ?valueRef) AS ?n3).
BIND (uri(?n3) AS ?newNet).
""" """
} }
# -- old ---
# rule_set['create-individual-net-2'] = {
# 'label': "create-individual-net-2",
# 'comment': ("Create Individual Net from AMR Leaf: ",
# " (1) with variable corresponding to a named entity ",
# " (2) with link to domain edge"),
# 'construction': """
# # -- New Individual Net
# ?newNet a net:Individual_Net ;
# net:hasStructure ?sentenceRef ;
# net:coverBaseNode ?baseLeaf ;
# net:coverArgNode ?rightLeaf ;
# net:hasMotherClassNet ?leftClassNet ;
# net:hasIndividualLabel ?varNameLabel.
# # -- Propagation of relations (from nodes to nets)
# ?inRelationRole a net:Relation.
# ?inNet ?inRelationRole ?newNet.
# ?outRelationRole a net:Relation.
# ?newNet ?outRelationRole ?outNet.
# """,
# 'clause': """
# # -- Identify individual covering leaf with domain relation
# ?leftClassNet a [rdfs:subClassOf* net:Class_Net] ;
# net:coverBaseNode ?baseLeaf ;
# net:hasClassName ?leftConceptName.
# ?rightLeaf a amr:AMR_Leaf ;
# amr:hasConcept ?rightConcept ;
# amr:hasVariable ?rightVariable.
# ?baseLeaf ?roleEdge ?rightLeaf.
# ?roleEdge amr:hasAmrRole amr:role_domain.
# ?leftVariable amr:label ?leftVariableLabel.
# ?rightVariable amr:name ?rightVariableName.
# ?rightVariableName rdfs:label ?varNameLabel.
# # -- Identify structure
# ?root a amr:AMR_Root ;
# amr:hasSentenceID ?sentenceRef.
# # -- Identify inbound relations linked to the base leaf (for propagation)
# OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ;
# net:coverBaseNode ?inLeaf.
# ?inLeaf ?inRelationEdge ?baseLeaf.
# ?inRelationEdge amr:hasAmrRole ?inRelationRole.}
# # -- Identify outgoing relations linked to the base leaf (for propagation)
# OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ;
# net:coverBaseNode ?outLeaf.
# ?baseLeaf ?outRelationEdge ?outLeaf.
# ?outRelationEdge amr:hasAmrRole ?outRelationRole.}
# """,
# 'binding': """
# # -- New Individual Net
# BIND (CONCAT(str(net:), 'individual') AS ?n1).
# BIND (CONCAT(?n1, '_', ?leftConceptName) AS ?n2).
# BIND (CONCAT(?n2, '_', ?leftVariableLabel) AS ?n3).
# BIND (uri(?n3) AS ?newNet).
# """
# }
# -- ---
# --------------------------------------------- # ---------------------------------------------
# Atomic Extraction: Property Net # Atomic Extraction: Property Net
...@@ -211,26 +109,20 @@ rule_set['create-atom-property-net-1'] = { ...@@ -211,26 +109,20 @@ rule_set['create-atom-property-net-1'] = {
'label': "create-atom-property-net-1", 'label': "create-atom-property-net-1",
'comment': ("Create Atom Property Net: ", 'comment': ("Create Atom Property Net: ",
" (1) from AMR Predicat Concept"), " (1) from AMR Predicat Concept"),
'construction': """ 'construction': f"""
# -- New Property Net {atom_property_net.construct(base_node='?baseLeaf',
?newNet a net:Atom_Property_Net ; structure='?sentenceRef',
net:isCoreRoleLinked true ; core_role='true',
net:hasStructure ?sentenceRef ; target_argument_node='?argLeaf',
net:coverBaseNode ?baseLeaf ; property_type='owl:ObjectProperty',
net:targetArgumentNode ?argLeaf ; property_name='?propertyName',
net:hasPropertyType owl:ObjectProperty ; property_name01='?propertyName01',
net:hasPropertyName ?propertyName ; property_name10='?propertyName10',
net:hasPropertyName01 ?propertyName01 ; property_name12='?propertyName12')}
net:hasPropertyName10 ?propertyName10 ;
net:hasPropertyName12 ?propertyName12. {atom_property_net.propagate_relations()}
# -- Propagation of relations (from nodes to nets)
?inRelationRole a net:Relation.
?inNet ?inRelationRole ?newNet.
?outRelationRole a net:Relation.
?newNet ?outRelationRole ?outNet.
""", """,
'clause': """ 'clause': f"""
# -- Identify property covering single leaf # -- Identify property covering single leaf
?baseLeaf a amr:AMR_Leaf ; ?baseLeaf a amr:AMR_Leaf ;
amr:hasConcept ?concept ; amr:hasConcept ?concept ;
...@@ -238,26 +130,18 @@ rule_set['create-atom-property-net-1'] = { ...@@ -238,26 +130,18 @@ rule_set['create-atom-property-net-1'] = {
?variable amr:label ?varLabel. ?variable amr:label ?varLabel.
?concept rdfs:subClassOf amr:AMR_Predicat_Concept ; ?concept rdfs:subClassOf amr:AMR_Predicat_Concept ;
amr:label ?predicateLabel. amr:label ?predicateLabel.
OPTIONAL {?baseLeaf ?relation ?argLeaf. OPTIONAL {{
?relation amr:hasAmrRole ?someArgRole.} ?baseLeaf ?relation ?argLeaf.
?relation amr:hasAmrRole ?someArgRole.
}}
# -- Identify structure # -- Identify structure
?root a amr:AMR_Root ; ?root a amr:AMR_Root ;
amr:hasSentenceID ?sentenceRef. amr:hasSentenceID ?sentenceRef.
# -- Identify inbound relations linked to the base leaf (for propagation) {atom_property_net.identify_relations_for_propagation('?baseLeaf')}
OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?inLeaf.
?inLeaf ?inRelationEdge ?baseLeaf.
?inRelationEdge amr:hasAmrRole ?inRelationRole.}
# -- Identify outgoing relations linked to the base leaf (for propagation)
OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?outLeaf.
?baseLeaf ?outRelationEdge ?outLeaf.
?outRelationEdge amr:hasAmrRole ?outRelationRole.}
""", """,
'binding': """ 'binding': f"""
BIND (STRBEFORE(?predicateLabel, '-') AS ?pName1). BIND (STRBEFORE(?predicateLabel, '-') AS ?pName1).
BIND (IF (STRLEN(?pName1) > 0, BIND (IF (STRLEN(?pName1) > 0,
?pName1, ?predicateLabel) AS ?propertyName) ?pName1, ?predicateLabel) AS ?propertyName)
...@@ -268,17 +152,7 @@ rule_set['create-atom-property-net-1'] = { ...@@ -268,17 +152,7 @@ rule_set['create-atom-property-net-1'] = {
BIND (IF (STRLEN(?pName1) > 0, BIND (IF (STRLEN(?pName1) > 0,
CONCAT(?propertyName, '-of'), ?predicateLabel) AS ?propertyName12) CONCAT(?propertyName, '-of'), ?predicateLabel) AS ?propertyName12)
# -- New Property Name {atom_property_net.bind_uri('?propertyName', '?varLabel')}
# -- old --- BIND (STRBEFORE(?predicateLabel, '-') AS ?propertyName).
# -- old --- BIND (CONCAT(?propertyName, 'ing') AS ?propertyName01).
# -- old --- BIND (CONCAT(?propertyName, '-by') AS ?propertyName10).
# -- old --- BIND (CONCAT(?propertyName, '-of') AS ?propertyName12).
# -- New Property Net
BIND (CONCAT(str(net:), 'atomProperty') AS ?n1).
BIND (CONCAT(?n1, '_', ?propertyName) AS ?n2).
BIND (CONCAT(?n2, '_', ?varLabel) AS ?n3).
BIND (uri(?n3) AS ?newNet).
""" """
} }
...@@ -287,7 +161,7 @@ rule_set['create-atom-property-net-1'] = { ...@@ -287,7 +161,7 @@ rule_set['create-atom-property-net-1'] = {
# 'label': "create-atom-property-net-2", # 'label': "create-atom-property-net-2",
# 'comment': ("Create Property Net from AMR Predicat Concept: ", # 'comment': ("Create Property Net from AMR Predicat Concept: ",
# " with variable corresponding to a negative polarity value "), # " with variable corresponding to a negative polarity value "),
# 'construction': """ # 'construction': f"""
# # -- New Property Net # # -- New Property Net
# ?newNet a net:Atom_Property_Net ; # ?newNet a net:Atom_Property_Net ;
# net:isCoreRoleLinked true ; # net:isCoreRoleLinked true ;
...@@ -335,7 +209,7 @@ rule_set['create-atom-property-net-1'] = { ...@@ -335,7 +209,7 @@ rule_set['create-atom-property-net-1'] = {
# ?baseLeaf ?outRelationEdge ?outLeaf. # ?baseLeaf ?outRelationEdge ?outLeaf.
# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} # ?outRelationEdge amr:hasAmrRole ?outRelationRole.}
# """, # """,
# 'binding': """ # 'binding': f"""
# # -- New Property Name # # -- New Property Name
# BIND (STRBEFORE(?predicateLabel, '-') AS ?basePropertyName). # BIND (STRBEFORE(?predicateLabel, '-') AS ?basePropertyName).
# BIND (CONCAT('not-', ?basePropertyName) AS ?propertyName). # BIND (CONCAT('not-', ?basePropertyName) AS ?propertyName).
...@@ -357,7 +231,7 @@ rule_set['create-atom-property-net-1'] = { ...@@ -357,7 +231,7 @@ rule_set['create-atom-property-net-1'] = {
# 'label': "create-atom-property-net-3", # 'label': "create-atom-property-net-3",
# 'comment': ("Create Atom Property Net: ", # 'comment': ("Create Atom Property Net: ",
# " (1) from AMR Non Core Role Edge"), # " (1) from AMR Non Core Role Edge"),
# 'construction': """ # 'construction': f"""
# # -- New Property Net # # -- New Property Net
# ?newNet a net:Atom_Property_Net ; # ?newNet a net:Atom_Property_Net ;
# net:isCoreRoleLinked false ; # net:isCoreRoleLinked false ;
...@@ -403,7 +277,7 @@ rule_set['create-atom-property-net-1'] = { ...@@ -403,7 +277,7 @@ rule_set['create-atom-property-net-1'] = {
# ?baseLeaf ?outRelationEdge ?outLeaf. # ?baseLeaf ?outRelationEdge ?outLeaf.
# ?outRelationEdge amr:hasAmrRole ?outRelationRole.} # ?outRelationEdge amr:hasAmrRole ?outRelationRole.}
# """, # """,
# 'binding': """ # 'binding': f"""
# # -- New Property Net # # -- New Property Net
# BIND (CONCAT(str(net:), 'atomProperty') AS ?n1). # BIND (CONCAT(str(net:), 'atomProperty') AS ?n1).
# BIND (CONCAT(?n1, '_', str(?roleName)) AS ?n2). # BIND (CONCAT(?n1, '_', str(?roleName)) AS ?n2).
...@@ -421,23 +295,17 @@ rule_set['create-atom-property-net-1'] = { ...@@ -421,23 +295,17 @@ rule_set['create-atom-property-net-1'] = {
rule_set['create-phenomena-net-1'] = { rule_set['create-phenomena-net-1'] = {
'label': "create-phenomena-net-1", 'label': "create-phenomena-net-1",
'comment': ("Create Phenomena Net from AMR Relation Concept"), 'comment': ("Create Phenomena Net from AMR Relation Concept"),
'construction': """ 'construction': f"""
# -- New Phenomena Net {phenomena_net.construct(base_node='?baseLeaf',
?newNet a net:Phenomena_Net ; structure='?sentenceRef',
net:isCoreRoleLinked true ; core_role='true',
net:hasStructure ?sentenceRef ; target_argument_node='?argLeaf',
net:coverBaseNode ?baseLeaf ; phenomena_type='?relationConceptPhenomena',
net:targetArgumentNode ?argLeaf ; phenomena_ref='?relationConceptLabel')}
net:hasPhenomenaType ?relationConceptPhenomena ;
net:hasPhenomenaRef ?relationConceptLabel. {phenomena_net.propagate_relations()}
# -- Propagation of relations (from nodes to nets)
?inRelationRole a net:Relation.
?inNet ?inRelationRole ?newNet.
?outRelationRole a net:Relation.
?newNet ?outRelationRole ?outNet.
""", """,
'clause': """ 'clause': f"""
# Identify relation concept (phenomena) covering a single leaf # Identify relation concept (phenomena) covering a single leaf
?baseLeaf a amr:AMR_Leaf ; ?baseLeaf a amr:AMR_Leaf ;
amr:hasConcept ?concept ; amr:hasConcept ?concept ;
...@@ -454,24 +322,10 @@ rule_set['create-phenomena-net-1'] = { ...@@ -454,24 +322,10 @@ rule_set['create-phenomena-net-1'] = {
?root a amr:AMR_Root ; ?root a amr:AMR_Root ;
amr:hasSentenceID ?sentenceRef. amr:hasSentenceID ?sentenceRef.
# -- Identify inbound relations linked to the base leaf (for propagation) {phenomena_net.identify_relations_for_propagation('?baseLeaf')}
OPTIONAL {?inNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?inLeaf.
?inLeaf ?inRelationEdge ?baseLeaf.
?inRelationEdge amr:hasAmrRole ?inRelationRole.}
# -- Identify outgoing relations linked to the base leaf (for propagation)
OPTIONAL {?outNet a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?outLeaf.
?baseLeaf ?outRelationEdge ?outLeaf.
?outRelationEdge amr:hasAmrRole ?outRelationRole.}
""", """,
'binding': """ 'binding': f"""
# -- New Phenomena Net {phenomena_net.bind_uri('?phenomenaLabel', '?varLabel')}
BIND (CONCAT(str(net:), 'phenomena') AS ?n1).
BIND (CONCAT(?n1, '_', ?phenomenaLabel) AS ?n2).
BIND (CONCAT(?n2, '_', ?varLabel) AS ?n3).
BIND (uri(?n3) AS ?newNet).
""" """
} }
...@@ -487,14 +341,20 @@ if __name__ == '__main__': ...@@ -487,14 +341,20 @@ if __name__ == '__main__':
print('\n' + ' -- test: Atom Class Net') print('\n' + ' -- test: Atom Class Net')
print(atom_class_net) print(atom_class_net)
print('\n' + ' -- test: update a test query') print('\n' + ' -- test: update a test query (1)')
test_query= f"""[...] test_query_1 = f"""[...]
CONSTRUCT {{ CONSTRUCT {{
{atom_class_net.construct(base_node='{{node1.id}}', {atom_property_net.construct(base_node='?baseLeaf',
structure='{{structure.sentence_ref}}', structure='?sentenceRef',
class_name='{{node1.concept_label}}')} core_role='true',
target_argument_node='?argLeaf',
property_type='owl:ObjectProperty',
property_name='?propertyName',
property_name01='?propertyName01',
property_name10='?propertyName10',
property_name12='?propertyName12')}
{atom_class_net.propagate_relations()} {atom_property_net.propagate_relations()}
}} }}
...@@ -506,12 +366,32 @@ if __name__ == '__main__': ...@@ -506,12 +366,32 @@ if __name__ == '__main__':
{{structure.identify()}} {{structure.identify()}}
{{atom_class_net.identify_relations_for_propagation()}} {atom_property_net.identify_relations_for_propagation('?baseLeaf')}
{atom_property_net.bind_uri('{{node1.concept_label}}',
'{{node1.variable_label}}')}
}}
"""
print(test_query_1)
print('\n' + ' -- test: update a test query (2)')
test_query_2 = f"""[...]
CONSTRUCT {{
{individual_net.construct(base_node='?baseLeaf',
structure='?sentenceRef',
mother_class_net='?classNet',
individual_label='?valueLabel')}
}}
WHERE {{
{{atom_class_net.bind_uri()}}
}} }}
""" """
print(test_query) print(test_query_2)
print('\n' + ' *** - ***') print('\n' + ' *** - ***')
...@@ -20,9 +20,18 @@ from .element.net import * ...@@ -20,9 +20,18 @@ from .element.net import *
#============================================================================== #==============================================================================
# -- Atom Class Net # -- Atom Class Net
atom_class_net = Net('atomClassNet', 'Atom_Class_Net') atom_class_net = Net('atomClass')
atom_class_net_1 = Net('atomClassNet1', 'Atom_Class_Net') atom_class_net_1 = Net('atomClass', 1)
atom_class_net_2 = Net('atomClassNet2', 'Atom_Class_Net') atom_class_net_2 = Net('atomClass', 2)
# -- Individual Net
individual_net = Net('individual')
# -- Atom Property Net
atom_property_net = Net('atomProperty')
# -- Phenomena Net
phenomena_net = Net('phenomena')
#============================================================================== #==============================================================================
......
...@@ -18,27 +18,49 @@ ...@@ -18,27 +18,49 @@
# Data Repository # Data Repository
#============================================================================== #==============================================================================
# -- Default References
DEFAULT_NET_ID = '?newNet'
DEFAULT_NET_TYPE = 'Net'
DEFAULT_SENTENCE_REF = '?sentenceRef'
DEFAULT_BASE_LEAF = '?baseLeaf'
DEFAULT_CLASS_NAME = '?className'
# -- Reference Table # -- Reference Table
DATA_PROPERTY_TABLE = { NET_TYPE_TABLE = { # *** [type_name: type_id] ***
'default': 'Net',
'atomClass': 'Atom_Class_Net',
'individual': 'Individual_Net',
'atomProperty': 'Atom_Property_Net',
'phenomena': 'Phenomena_Net'
}
PREDICATE_TABLE = { # *** [attribute_reference: attribute_predicate] ***
'structure': 'hasStructure', 'structure': 'hasStructure',
'class_name': 'hasClassName', 'class_name': 'hasClassName',
'mother_class_net': 'hasMotherClassNet', 'mother_class_net': 'hasMotherClassNet',
'individual_label': 'hasIndividualLabel' 'individual_label': 'hasIndividualLabel',
'core_role': 'isCoreRoleLinked',
'target_argument_node': 'targetArgumentNode',
'property_type': 'hasPropertyType',
'property_name': 'hasPropertyName',
'property_name01': 'hasPropertyName01',
'property_name10': 'hasPropertyName10',
'property_name12': 'hasPropertyName12',
'phenomena_type': 'hasPhenomenaType',
'phenomena_ref': 'hasPhenomenaRef'
} }
# -- Default Value(s)
DEFAULT_ATTRIBUTE_VALUE = f'\"NA\"'
# -- Useful Constant(s)
TRIPLE_ENDING_STR = '\n '
#============================================================================== #==============================================================================
# Class # Net Class
#============================================================================== #==============================================================================
class Net: class Net:
...@@ -49,48 +71,69 @@ class Net: ...@@ -49,48 +71,69 @@ class Net:
# Constructor(s) # Constructor(s)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def __init__(self, id='defaultNetId', type='Net'): def __init__(self, type_name='default', num=''):
# -- Net Signature # -- Net Signature
self.id = f'?{id}' self.id = f'?{type_name}Net{num}'
self.type = f'net:{type}' self.type_name = type_name
self.base_node = f'?{id}BaseNode' self.type_uri = f'net:{NET_TYPE_TABLE[type_name]}'
# -- Net Data # -- Net Attributes
self.structure = f'?{id}Structure' self.base_node = f'{self.id}BaseNode'
self.class_name = f'?{id}ClassName' self.structure = f'{self.id}Structure'
self.mother_class_net = f'?{id}MotherClassNet' self.class_name = f'{self.id}ClassName'
self.individual_label = f'?{id}IndividualLabel' self.mother_class_net = f'{self.id}MotherClassNet'
self.individual_label = f'{self.id}IndividualLabel'
# -- Private elements (for relation propagation) # -- Private elements (for relation propagation)
self._in_relation_role = f'?{id}InRelationRole' self._in_relation_role = f'{self.id}InRelationRole'
self._in_net = f'?{id}InNet' self._in_net = f'{self.id}InNet'
self._out_relation_role = f'?{id}OutRelationRole' self._out_relation_role = f'{self.id}OutRelationRole'
self._out_net = f'?{id}OutNet' self._out_net = f'{self.id}OutNet'
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Construct Method(s) # Private data accessor(s)
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def __get_data_property(self, data_ref): def __get_predicate(self, data_ref):
property_name = DATA_PROPERTY_TABLE[f'{data_ref}'] property_name = PREDICATE_TABLE[f'{data_ref}']
return f'net:{property_name}' return f'net:{property_name}'
def __get_net_data(self, **net_data): #--------------------------------------------------------------------------
data_str = "" # Method(s) to build 'Construct' parts
for data_ref, data_val in net_data.items(): #--------------------------------------------------------------------------
data_property = self.__get_data_property(data_ref)
data_str += f"{self.id} {data_property} {data_val}.\n " def __construct_attribute_triples(self, **net_attribute):
return data_str
result_triples = ""
# -- construct triples with declared attributes
for attr_ref, attr_value in net_attribute.items():
predicate = self.__get_predicate(attr_ref)
result_triples += f"{self.id} {predicate} {attr_value}."
result_triples += f"{TRIPLE_ENDING_STR}"
# -- construct triples with default object for non-declared attributes
result_triples += f"# *** default values for attribute useless *** "
result_triples += f"{TRIPLE_ENDING_STR}"
for attr_ref in PREDICATE_TABLE.keys():
if attr_ref not in net_attribute.keys():
predicate = self.__get_predicate(attr_ref)
result_triples += f"{self.id} {predicate} {DEFAULT_ATTRIBUTE_VALUE}."
result_triples += f"{TRIPLE_ENDING_STR}"
def construct(self, base_node, **net_data): return result_triples
def construct(self, base_node, **net_attribute):
return f""" return f"""
# -- New Class Net # -- New Net
{self.id} a {self.type}. {self.id} a {self.type_uri}.
{self.id} net:coverBaseNode {base_node}. {self.id} net:coverBaseNode {base_node}.
{self.__get_net_data(**net_data)}""" {self.__construct_attribute_triples(**net_attribute)}"""
def propagate_relations(self): def propagate_relations(self):
return f""" return f"""
...@@ -103,16 +146,48 @@ class Net: ...@@ -103,16 +146,48 @@ class Net:
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Method(s) to get the SPARQL query corresponding to the rule # Method(s) to build 'Clause' parts
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def identify_relations_for_propagation(self, base_node):
return f"""
# -- Identify inbound relations linked to the base leaf (for propagation)
OPTIONAL {{
{self._in_net} a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?inLeaf.
?inLeaf ?inRelationEdge {base_node}.
?inRelationEdge amr:hasAmrRole {self._in_relation_role}.
}}
# -- Identify outgoing relations linked to the base leaf (for propagation)
OPTIONAL {{
{self._out_net} a [rdfs:subClassOf* net:Net] ;
net:coverBaseNode ?outLeaf.
{base_node} ?outRelationEdge ?outLeaf.
?outRelationEdge amr:hasAmrRole {self._out_relation_role}.
}}
"""
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
# Method(s) to update a graph by running the rule SPARQL query # Method(s) to build 'Binding' parts
#-------------------------------------------------------------------------- #--------------------------------------------------------------------------
def bind_uri(self, net_name='nameless', node_reference='00'):
ref1 = f"{self.id}Ref1"
ref2 = f"{self.id}Ref2"
ref3 = f"{self.id}Ref3"
refNet = f"{net_name}RefNet"
refNode = f"{node_reference}RefNode"
return f"""
# -- New Net
BIND (REPLACE({net_name}, ' ', "") AS {refNet}).
BIND (REPLACE({node_reference}, ' ', "") AS {refNode}).
BIND (CONCAT(str(net:), '{self.type_name}') AS {ref1}).
BIND (CONCAT({ref1}, '_', {refNet}) AS {ref2}).
BIND (CONCAT({ref2}, '_', {refNode}) AS {ref3}).
BIND (uri({ref3}) AS {self.id})."""
...@@ -125,7 +200,7 @@ if __name__ == '__main__': ...@@ -125,7 +200,7 @@ if __name__ == '__main__':
print('\n' + ' *** Development Test ***') print('\n' + ' *** Development Test ***')
print('\n' + ' -- test: Atom Class Net') print('\n' + ' -- test: Atom Class Net')
atom_class_net = Net('atomClassNet', 'Atom_Class_Net') atom_class_net = Net('atomClass')
print(atom_class_net) print(atom_class_net)
...@@ -148,8 +223,11 @@ if __name__ == '__main__': ...@@ -148,8 +223,11 @@ if __name__ == '__main__':
WHERE {{ WHERE {{
clause_1 clause_1
clause_2 clause_2
[...]
binding {atom_class_net.identify_relations_for_propagation('?node1')}
{atom_class_net.bind_uri('{{node1.concept_label}}',
'{{node1.variable_label}}')}
}} }}
""" """
print(test_query) print(test_query)
......
...@@ -23,8 +23,8 @@ ...@@ -23,8 +23,8 @@
----- CTS directory: ./structure/cts/ ----- CTS directory: ./structure/cts/
----- target frame directory: ./input/targetFrameStructure/ ----- target frame directory: ./input/targetFrameStructure/
----- input document directory: ./input/amrDocuments/ ----- input document directory: ./input/amrDocuments/
----- output directory: ./output/SolarSystemDev1-20221214/ ----- output directory: ./output/SolarSystemDev1-20221215/
----- sentence output directory: ./output/SolarSystemDev1-20221214/ ----- sentence output directory: ./output/SolarSystemDev1-20221215/
----- SHACL binary directory: ./lib/shacl-1.3.2/bin ----- SHACL binary directory: ./lib/shacl-1.3.2/bin
-- Config File Definition -- Config File Definition
----- schema file: ./structure/amr-rdf-schema.ttl ----- schema file: ./structure/amr-rdf-schema.ttl
...@@ -44,9 +44,9 @@ ...@@ -44,9 +44,9 @@
----- frame ontology seed file: ./input/targetFrameStructure/base-ontology-seed.ttl ----- frame ontology seed file: ./input/targetFrameStructure/base-ontology-seed.ttl
-- Output -- Output
----- ontology namespace: https://tenet.tetras-libre.fr/base-ontology/ ----- ontology namespace: https://tenet.tetras-libre.fr/base-ontology/
----- output file: ./output/SolarSystemDev1-20221214/SolarSystemDev1.ttl ----- output file: ./output/SolarSystemDev1-20221215/SolarSystemDev1.ttl
*** - *** *** - ***
- INFO - -- Creating output target directory: ./output/SolarSystemDev1-20221214/ - INFO - -- Creating output target directory: ./output/SolarSystemDev1-20221215/
- DEBUG - -- Counting number of graph files (sentences) - DEBUG - -- Counting number of graph files (sentences)
- DEBUG - ----- Graph count: 1 - DEBUG - ----- Graph count: 1
- INFO - === Extraction Processing using New TENET Engine === - INFO - === Extraction Processing using New TENET Engine ===
...@@ -64,9 +64,9 @@ ...@@ -64,9 +64,9 @@
- DEBUG - ----- Sentence Loading - DEBUG - ----- Sentence Loading
- DEBUG - -------- ./input/amrDocuments/dev/solar-system-1/SSC-01-01.stog.amr.ttl (614) - DEBUG - -------- ./input/amrDocuments/dev/solar-system-1/SSC-01-01.stog.amr.ttl (614)
- DEBUG - --- Export work graph as turtle - DEBUG - --- Export work graph as turtle
- DEBUG - ----- Work graph file: ./output/SolarSystemDev1-20221214/SolarSystemDev1-1/SolarSystemDev1.ttl - DEBUG - ----- Work graph file: ./output/SolarSystemDev1-20221215/SolarSystemDev1-1/SolarSystemDev1.ttl
- DEBUG - --- Ending Structure Preparation - DEBUG - --- Ending Structure Preparation
- DEBUG - ----- Total Execution Time = 0:00:00.201392 - DEBUG - ----- Total Execution Time = 0:00:00.122984
- INFO - -- Loading Extraction Scheme (amr_scheme_1) - INFO - -- Loading Extraction Scheme (amr_scheme_1)
- DEBUG - ----- Step number: 3 - DEBUG - ----- Step number: 3
- INFO - -- Loading Extraction Rules (amr_ctr/*) - INFO - -- Loading Extraction Rules (amr_ctr/*)
...@@ -95,133 +95,133 @@ ...@@ -95,133 +95,133 @@
- DEBUG - --- Serializing graph to SolarSystemDev1_preprocessing - DEBUG - --- Serializing graph to SolarSystemDev1_preprocessing
- DEBUG - ----- step: preprocessing - DEBUG - ----- step: preprocessing
- DEBUG - ----- id: SolarSystemDev1 - DEBUG - ----- id: SolarSystemDev1
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221214/SolarSystemDev1-1/SolarSystemDev1_preprocessing.ttl - DEBUG - ----- work_file: ./output/SolarSystemDev1-20221215/SolarSystemDev1-1/SolarSystemDev1_preprocessing.ttl
- DEBUG - ----- base: http://SolarSystemDev1/preprocessing - DEBUG - ----- base: http://SolarSystemDev1/preprocessing
- INFO - ----- 212 triples extracted during preprocessing step - INFO - ----- 212 triples extracted during preprocessing step
- INFO - -- Applying extraction step: transduction - INFO - -- Applying extraction step: transduction
- INFO - --- Sequence: atomic-extraction-sequence - INFO - --- Sequence: atomic-extraction-sequence
- INFO - ----- create-atom-class-net: 20/20 new triples (846) - INFO - ----- create-atom-class-net: 75/75 new triples (901)
- DEBUG - ----- (refinement) refine-cover-node-1: 5 new triples (851) - DEBUG - ----- (refinement) refine-cover-node-1: 5 new triples (906)
- DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (856) - DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (911)
- INFO - ----- create-individual-net-1: 7/7 new triples (863) - INFO - ----- create-individual-net-1: 17/17 new triples (928)
- DEBUG - ----- (refinement) refine-cover-node-1: 1 new triples (864) - DEBUG - ----- (refinement) refine-cover-node-1: 1 new triples (929)
- INFO - ----- create-atom-property-net-1: 69/69 new triples (933) - INFO - ----- create-atom-property-net-1: 99/99 new triples (1028)
- DEBUG - ----- (refinement) refine-cover-node-1: 6 new triples (939) - DEBUG - ----- (refinement) refine-cover-node-1: 6 new triples (1034)
- INFO - ----- create-phenomena-net-1: 24/25 new triples (963) - INFO - ----- create-phenomena-net-1: 40/41 new triples (1074)
- DEBUG - ----- (refinement) refine-cover-node-1: 2 new triples (965) - DEBUG - ----- (refinement) refine-cover-node-1: 2 new triples (1076)
- INFO - --- Sequence: atomic-extraction-sequence - INFO - --- Sequence: atomic-extraction-sequence
- INFO - ----- create-atom-class-net: 1/34 new triples (966) - INFO - ----- create-atom-class-net: 1/89 new triples (1077)
- DEBUG - ----- create-individual-net-1: 0/7 new triples (966) - DEBUG - ----- create-individual-net-1: 0/17 new triples (1077)
- INFO - ----- create-atom-property-net-1: 1/76 new triples (967) - INFO - ----- create-atom-property-net-1: 1/106 new triples (1078)
- DEBUG - ----- create-phenomena-net-1: 0/25 new triples (967) - DEBUG - ----- create-phenomena-net-1: 0/41 new triples (1078)
- INFO - --- Sequence: phenomena-checking-sequence - INFO - --- Sequence: phenomena-checking-sequence
- INFO - ----- expand-and-conjunction-phenomena-net: 4/4 new triples (971) - INFO - ----- expand-and-conjunction-phenomena-net: 4/4 new triples (1082)
- DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (971) - DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (1082)
- DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (971) - DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (1082)
- DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (971) - DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (1082)
- DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (971) - DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (1082)
- DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (971) - DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (1082)
- DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (971) - DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (1082)
- INFO - --- Sequence: composite-property-extraction-sequence - INFO - --- Sequence: composite-property-extraction-sequence
- DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (971) - DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (1082)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (971) - DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1082)
- INFO - --- Sequence: composite-class-extraction-sequence-1 - INFO - --- Sequence: composite-class-extraction-sequence-1
- INFO - ----- create-composite-class-net-from-property-1: 75/79 new triples (1046) - INFO - ----- create-composite-class-net-from-property-1: 75/79 new triples (1157)
- DEBUG - ----- (refinement) refine-cover-node-1: 12 new triples (1058) - DEBUG - ----- (refinement) refine-cover-node-1: 12 new triples (1169)
- DEBUG - ----- (refinement) refine-cover-node-2: 4 new triples (1062) - DEBUG - ----- (refinement) refine-cover-node-2: 4 new triples (1173)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1062) - DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1173)
- DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1062) - DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1173)
- INFO - --- Sequence: composite-class-extraction-sequence-2 - INFO - --- Sequence: composite-class-extraction-sequence-2
- DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1062) - DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1173)
- DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1062) - DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1173)
- DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1062) - DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1173)
- DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1062) - DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1173)
- INFO - --- Sequence: phenomena-checking-sequence - INFO - --- Sequence: phenomena-checking-sequence
- INFO - ----- expand-and-conjunction-phenomena-net: 1/5 new triples (1063) - INFO - ----- expand-and-conjunction-phenomena-net: 1/5 new triples (1174)
- DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (1063) - DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (1174)
- DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (1063) - DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (1174)
- DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (1063) - DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (1174)
- DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (1063) - DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (1174)
- DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (1063) - DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (1174)
- DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (1063) - DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (1174)
- INFO - --- Sequence: composite-property-extraction-sequence - INFO - --- Sequence: composite-property-extraction-sequence
- DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (1063) - DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (1174)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1063) - DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1174)
- INFO - --- Sequence: composite-class-extraction-sequence-1 - INFO - --- Sequence: composite-class-extraction-sequence-1
- INFO - ----- create-composite-class-net-from-property-1: 94/173 new triples (1157) - INFO - ----- create-composite-class-net-from-property-1: 94/173 new triples (1268)
- DEBUG - ----- (refinement) refine-cover-node-1: 15 new triples (1172) - DEBUG - ----- (refinement) refine-cover-node-1: 15 new triples (1283)
- DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (1177) - DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (1288)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1177) - DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1288)
- DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1177) - DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1288)
- INFO - --- Sequence: composite-class-extraction-sequence-2 - INFO - --- Sequence: composite-class-extraction-sequence-2
- DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1177) - DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1288)
- DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1177) - DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1288)
- DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1177) - DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1288)
- DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1177) - DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1288)
- INFO - --- Sequence: restriction-adding-sequence - INFO - --- Sequence: restriction-adding-sequence
- DEBUG - ----- add-restriction-to-class-net-from-property-1: 0/0 new triples (1177) - DEBUG - ----- add-restriction-to-class-net-from-property-1: 0/0 new triples (1288)
- INFO - --- Sequence: classification-sequence - INFO - --- Sequence: classification-sequence
- INFO - ----- classify-net-from-core-1: 12/12 new triples (1189) - INFO - ----- classify-net-from-core-1: 12/12 new triples (1300)
- INFO - ----- classify-net-from-core-2: 1/9 new triples (1190) - INFO - ----- classify-net-from-core-2: 1/9 new triples (1301)
- DEBUG - ----- classify-net-from-core-3: 0/0 new triples (1190) - DEBUG - ----- classify-net-from-core-3: 0/0 new triples (1301)
- DEBUG - ----- classify-net-from-mod: 0/0 new triples (1190) - DEBUG - ----- classify-net-from-mod: 0/0 new triples (1301)
- DEBUG - ----- classify-net-from-part: 0/0 new triples (1190) - DEBUG - ----- classify-net-from-part: 0/0 new triples (1301)
- INFO - ----- classify-net-from-domain: 6/6 new triples (1196) - INFO - ----- classify-net-from-domain: 6/6 new triples (1307)
- DEBUG - ----- classify-net-from-degree-phenomena-1: 0/0 new triples (1196) - DEBUG - ----- classify-net-from-degree-phenomena-1: 0/0 new triples (1307)
- DEBUG - ----- classify-net-from-degree-phenomena-2: 0/0 new triples (1196) - DEBUG - ----- classify-net-from-degree-phenomena-2: 0/0 new triples (1307)
- DEBUG - ----- classify-net-from-degree-phenomena-3: 0/0 new triples (1196) - DEBUG - ----- classify-net-from-degree-phenomena-3: 0/0 new triples (1307)
- DEBUG - ----- propagate-individual-1: 0/1 new triples (1196) - DEBUG - ----- propagate-individual-1: 0/1 new triples (1307)
- INFO - ----- propagate-individual-2: 6/6 new triples (1202) - INFO - ----- propagate-individual-2: 6/6 new triples (1313)
- DEBUG - ----- reclassify-deprecated-net: 0/0 new triples (1202) - DEBUG - ----- reclassify-deprecated-net: 0/0 new triples (1313)
- DEBUG - --- Serializing graph to SolarSystemDev1_transduction - DEBUG - --- Serializing graph to SolarSystemDev1_transduction
- DEBUG - ----- step: transduction - DEBUG - ----- step: transduction
- DEBUG - ----- id: SolarSystemDev1 - DEBUG - ----- id: SolarSystemDev1
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221214/SolarSystemDev1-1/SolarSystemDev1_transduction.ttl - DEBUG - ----- work_file: ./output/SolarSystemDev1-20221215/SolarSystemDev1-1/SolarSystemDev1_transduction.ttl
- DEBUG - ----- base: http://SolarSystemDev1/transduction - DEBUG - ----- base: http://SolarSystemDev1/transduction
- INFO - ----- 376 triples extracted during transduction step - INFO - ----- 487 triples extracted during transduction step
- INFO - -- Applying extraction step: generation - INFO - -- Applying extraction step: generation
- INFO - --- Sequence: main-generation-sequence - INFO - --- Sequence: main-generation-sequence
- INFO - ----- compute-uri-for-owl-declaration-1: 14/14 new triples (1216) - INFO - ----- compute-uri-for-owl-declaration-1: 14/14 new triples (1327)
- INFO - ----- compute-uri-for-owl-declaration-2: 1/1 new triples (1217) - INFO - ----- compute-uri-for-owl-declaration-2: 1/1 new triples (1328)
- DEBUG - ----- compute-uri-for-owl-declaration-4: 0/0 new triples (1217) - DEBUG - ----- compute-uri-for-owl-declaration-4: 0/0 new triples (1328)
- INFO - ----- compute-uri-for-owl-declaration-5: 6/6 new triples (1223) - INFO - ----- compute-uri-for-owl-declaration-5: 6/6 new triples (1334)
- INFO - ----- compute-uri-for-owl-declaration-6: 6/6 new triples (1229) - INFO - ----- compute-uri-for-owl-declaration-6: 6/6 new triples (1340)
- INFO - ----- generate-atom-class: 12/12 new triples (1241) - INFO - ----- generate-atom-class: 12/12 new triples (1352)
- INFO - ----- classify-atom-class-1: 4/4 new triples (1245) - INFO - ----- classify-atom-class-1: 4/4 new triples (1356)
- INFO - ----- classify-atom-class-2: 1/1 new triples (1246) - INFO - ----- classify-atom-class-2: 1/1 new triples (1357)
- INFO - ----- generate-individual: 3/3 new triples (1249) - INFO - ----- generate-individual: 3/3 new triples (1360)
- INFO - ----- classify-individual: 6/6 new triples (1255) - INFO - ----- classify-individual: 6/6 new triples (1366)
- INFO - ----- generate-atom-property-1: 20/20 new triples (1275) - INFO - ----- generate-atom-property-1: 20/20 new triples (1386)
- INFO - ----- generate-atom-property-12: 12/20 new triples (1287) - INFO - ----- generate-atom-property-12: 12/20 new triples (1398)
- DEBUG - ----- generate-inverse-relation: 0/0 new triples (1287) - DEBUG - ----- generate-inverse-relation: 0/0 new triples (1398)
- INFO - ----- generate-composite-class: 38/38 new triples (1325) - INFO - ----- generate-composite-class: 38/38 new triples (1436)
- DEBUG - ----- add-restriction-to-class-1: 0/0 new triples (1325) - DEBUG - ----- add-restriction-to-class-1: 0/0 new triples (1436)
- DEBUG - ----- add-restriction-to-class-2: 0/0 new triples (1325) - DEBUG - ----- add-restriction-to-class-2: 0/0 new triples (1436)
- INFO - ----- add-restriction-to-class-3: 36/45 new triples (1361) - INFO - ----- add-restriction-to-class-3: 36/45 new triples (1472)
- DEBUG - ----- add-restriction-to-class-4: 0/0 new triples (1361) - DEBUG - ----- add-restriction-to-class-4: 0/0 new triples (1472)
- DEBUG - ----- add-restriction-to-class-5: 0/0 new triples (1361) - DEBUG - ----- add-restriction-to-class-5: 0/0 new triples (1472)
- DEBUG - ----- add-restriction-to-class-6: 0/0 new triples (1361) - DEBUG - ----- add-restriction-to-class-6: 0/0 new triples (1472)
- DEBUG - ----- generate-composite-property: 0/0 new triples (1361) - DEBUG - ----- generate-composite-property: 0/0 new triples (1472)
- DEBUG - --- Serializing graph to SolarSystemDev1_generation - DEBUG - --- Serializing graph to SolarSystemDev1_generation
- DEBUG - ----- step: generation - DEBUG - ----- step: generation
- DEBUG - ----- id: SolarSystemDev1 - DEBUG - ----- id: SolarSystemDev1
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221214/SolarSystemDev1-1/SolarSystemDev1_generation.ttl - DEBUG - ----- work_file: ./output/SolarSystemDev1-20221215/SolarSystemDev1-1/SolarSystemDev1_generation.ttl
- DEBUG - ----- base: http://SolarSystemDev1/generation - DEBUG - ----- base: http://SolarSystemDev1/generation
- INFO - ----- 159 triples extracted during generation step - INFO - ----- 159 triples extracted during generation step
- INFO - -- Result: file containing only the factoids - INFO - -- Result: file containing only the factoids
- DEBUG - --- Making factoid graph with the last step result - DEBUG - --- Making factoid graph with the last step result
- DEBUG - ----- Number of factoids: 176 - DEBUG - ----- Number of factoids: 176
- DEBUG - ----- Graph base: http://SolarSystemDev1/factoid - DEBUG - ----- Graph base: http://SolarSystemDev1/factoid
- DEBUG - --- Serializing graph to factoid file (./output/SolarSystemDev1-20221214/SolarSystemDev1-1/SolarSystemDev1_factoid.ttl) - DEBUG - --- Serializing graph to factoid file (./output/SolarSystemDev1-20221215/SolarSystemDev1-1/SolarSystemDev1_factoid.ttl)
- INFO - - INFO -
*** Execution Time *** *** Execution Time ***
----- Function: apply (lib.tenet_extraction) ----- Function: apply (lib.tenet_extraction)
----- Total Time: 0:00:08.164996 ----- Total Time: 0:00:07.695899
----- Process Time: 0:00:08.033522 ----- Process Time: 0:00:07.663001
*** - *** *** - ***
- INFO - === Final Ontology Generation === - INFO - === Final Ontology Generation ===
- INFO - -- Making complete factoid graph by merging sentence factoid graphs - INFO - -- Making complete factoid graph by merging sentence factoid graphs
- INFO - ----- Total factoid number: 176 - INFO - ----- Total factoid number: 176
- INFO - ----- Graph base: http://SolarSystemDev1/factoid - INFO - ----- Graph base: http://SolarSystemDev1/factoid
- INFO - -- Serializing graph to factoid file (./output/SolarSystemDev1-20221214/SolarSystemDev1_factoid.ttl) - INFO - -- Serializing graph to factoid file (./output/SolarSystemDev1-20221215/SolarSystemDev1_factoid.ttl)
- INFO - === Done === - INFO - === Done ===
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment