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

Update and valid Atomic-extraction CTR with QB

parent 4abf602d
No related branches found
No related tags found
No related merge requests found
Showing
with 160 additions and 859 deletions
......@@ -58,27 +58,8 @@ rule_set['compute-uri-for-owl-declaration-2'] = {
"""
}
rule_set['compute-uri-for-owl-declaration-3----old'] = {
rule_set['compute-uri-for-owl-declaration-3'] = {
'label': "compute-uri-for-owl-declaration-3",
'comment': ("Compute URI for OWL declaration: ",
" mother class URI of individuals ",
" (case with an extracted mother class) "),
'construction': """
?net1 net:hasMotherClassURI ?newMotherClassUri.
""",
'clause': """
?net1 a net:Individual_Net ;
net:hasMotherClassNet ?motherClassName.
FILTER NOT EXISTS { ?net1 net:deprecated true. }
""",
'binding': """
BIND (CONCAT(str(ext-out:), str(?motherClassName)) AS ?c1).
BIND (uri(?c1) AS ?newMotherClassUri).
"""
}
rule_set['compute-uri-for-owl-declaration-4'] = {
'label': "compute-uri-for-owl-declaration-4",
'comment': ("Compute URI for OWL declaration: ",
" mother class URI of individuals ",
" (case with a base ontology class) "),
......@@ -96,8 +77,8 @@ rule_set['compute-uri-for-owl-declaration-4'] = {
"""
}
rule_set['compute-uri-for-owl-declaration-5'] = {
'label': "compute-uri-for-owl-declaration-5",
rule_set['compute-uri-for-owl-declaration-4'] = {
'label': "compute-uri-for-owl-declaration-4",
'comment': ("Compute URI for OWL declaration: ",
" URI of properties "),
'construction': """
......@@ -114,8 +95,8 @@ rule_set['compute-uri-for-owl-declaration-5'] = {
"""
}
rule_set['compute-uri-for-owl-declaration-6'] = {
'label': "compute-uri-for-owl-declaration-6",
rule_set['compute-uri-for-owl-declaration-5'] = {
'label': "compute-uri-for-owl-declaration-5",
'comment': ("Compute URI for OWL declaration: ",
" URI of properties (variant 12) "),
'construction': """
......
......@@ -62,11 +62,8 @@ rule_set['create-individual-net-1'] = {
" (2) without link to domain edge"),
'construction': f"""
{individual_net.construct(base_node='?baseLeaf',
structure=structure.sentence_ref,
mother_class_net='?classNet',
individual_label='?valueLabel')}
{individual_net.propagate_relations()}
""",
'clause': f"""
# -- Identify name relation between a leaf and a value
......@@ -82,9 +79,7 @@ rule_set['create-individual-net-1'] = {
net:coverBaseNode ?baseLeaf ;
net:hasClassName ?conceptName.
{structure.identify()}
{individual_net.identify_relations_for_propagation('?baseLeaf')}
{individual_net.complete_clauses_for_construction('?baseLeaf')}
""",
'binding': f"""
{individual_net.bind_uri('?conceptName', '?valueLabel')}
......@@ -102,7 +97,6 @@ rule_set['create-atom-property-net-1'] = {
" (1) from AMR Predicat Concept"),
'construction': f"""
{atom_property_net.construct(base_node='?baseLeaf',
structure=structure.sentence_ref,
core_role='true',
target_argument_node='?argLeaf',
property_type='owl:ObjectProperty',
......@@ -110,8 +104,6 @@ rule_set['create-atom-property-net-1'] = {
property_name01='?propertyName01',
property_name10='?propertyName10',
property_name12='?propertyName12')}
{atom_property_net.propagate_relations()}
""",
'clause': f"""
# -- Identify property covering single leaf
......@@ -126,9 +118,7 @@ rule_set['create-atom-property-net-1'] = {
?relation amr:hasAmrRole ?someArgRole.
}}
{structure.identify()}
{atom_property_net.identify_relations_for_propagation('?baseLeaf')}
{atom_property_net.complete_clauses_for_construction('?baseLeaf')}
""",
'binding': f"""
BIND (STRBEFORE(?predicateLabel, '-') AS ?pName1).
......@@ -286,13 +276,8 @@ rule_set['create-phenomena-net-1'] = {
'comment': ("Create Phenomena Net from AMR Relation Concept"),
'construction': f"""
{phenomena_net.construct(base_node='?baseLeaf',
structure=structure.sentence_ref,
core_role='true',
target_argument_node='?argLeaf',
phenomena_type='?relationConceptPhenomena',
phenomena_ref='?relationConceptLabel')}
{phenomena_net.propagate_relations()}
""",
'clause': f"""
# Identify relation concept (phenomena) covering a single leaf
......@@ -307,9 +292,7 @@ rule_set['create-phenomena-net-1'] = {
?baseLeaf ?relation ?argLeaf.
?relation amr:hasAmrRole ?someArgRole.
{structure.identify()}
{phenomena_net.identify_relations_for_propagation('?baseLeaf')}
{phenomena_net.complete_clauses_for_construction('?baseLeaf')}
""",
'binding': f"""
{phenomena_net.bind_uri('?phenomenaLabel', '?varLabel')}
......@@ -332,7 +315,6 @@ if __name__ == '__main__':
test_query_1 = f"""[...]
CONSTRUCT {{
{atom_property_net.construct(base_node='?baseLeaf',
structure=structure.sentence_ref,
core_role='true',
target_argument_node='?argLeaf',
property_type='owl:ObjectProperty',
......@@ -341,8 +323,6 @@ if __name__ == '__main__':
property_name10='?propertyName10',
property_name12='?propertyName12')}
{atom_property_net.propagate_relations()}
}}
WHERE {{
......@@ -351,9 +331,7 @@ if __name__ == '__main__':
{{node1.concept}} amr:label ?conceptName.
{{node1.variable}} amr:label ?varLabel.
{structure.identify()}
{atom_property_net.identify_relations_for_propagation('?baseLeaf')}
{atom_property_net.complete_clauses_for_construction('?baseLeaf')}
{atom_property_net.bind_uri('{{node1.concept_label}}',
'{{node1.variable_label}}')}
......@@ -366,7 +344,6 @@ if __name__ == '__main__':
test_query_2 = f"""[...]
CONSTRUCT {{
{individual_net.construct(base_node='?baseLeaf',
structure=structure.sentence_ref,
mother_class_net='?classNet',
individual_label='?valueLabel')}
......
......@@ -12,17 +12,11 @@
# Importing required modules
#==============================================================================
from .element.old_net import OldNet
from .element.net import Net
from .element.atom_class_net import AtomClassNet
from .element.structure import Structure
#==============================================================================
# AMR Structure Builder(s)
#==============================================================================
structure = Structure()
from .element.individual_net import IndividualNet
from .element.atom_property_net import AtomPropertyNet
from .element.phenomena_net import PhenomenaNet
#==============================================================================
......@@ -35,52 +29,17 @@ atom_class_net_1 = AtomClassNet(1)
atom_class_net_2 = AtomClassNet(2)
# -- Individual Net
individual_net = OldNet('individual')
individual_net = IndividualNet()
# -- Atom Property Net
atom_property_net = OldNet('atomProperty')
atom_property_net = AtomPropertyNet()
# -- Phenomena Net
phenomena_net = OldNet('phenomena')
phenomena_net = PhenomenaNet()
#==============================================================================
# Node Builder(s)
# AMR Structure Builder(s)
#==============================================================================
# TODO
\ No newline at end of file
#==============================================================================
# Development Test
#==============================================================================
if __name__ == '__main__':
print('\n' + ' *** Development Test ***')
print('\n' + ' -- test: Atom Class Net')
print(atom_class_net)
print('\n' + ' -- test: update a test query')
test_query= f"""[...]
CONSTRUCT {{
{atom_class_net.construct('?node1',
structure='?structureRef',
class_name='?leaf1ConceptLabel')}
{atom_class_net.propagate_relations()}
}}
WHERE {{
clause_1
clause_2
[...]
binding
}}
"""
print(test_query)
print('\n' + ' *** - ***')
\ No newline at end of file
......@@ -2,7 +2,7 @@
# -*-coding:Utf-8 -*
#==============================================================================
# TENET: Net Query Builder
# TENET: Atom Class Net Query Builder
#------------------------------------------------------------------------------
# Class to generate SPARQL query parts related to semantic nets
#==============================================================================
......@@ -14,51 +14,6 @@
from .net import Net
#==============================================================================
# Data Repository
#==============================================================================
# -- Reference 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',
# 'class_name': 'hasClassName',
# 'mother_class_net': 'hasMotherClassNet',
# '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 '
#==============================================================================
# Net Class
#==============================================================================
......@@ -116,34 +71,24 @@ if __name__ == '__main__':
print('\n' + ' *** Development Test ***')
print('\n' + ' -- test: Atom Class Net')
atom_class_net = AtomClassNet()
print(atom_class_net)
print('\n' + ' -- test: construct')
construct_ctr = atom_class_net.construct(base_node='?node1',
structure='?structureRef',
class_name='?leaf1ConceptLabel')
print(construct_ctr)
print('\n' + ' -- test: Net')
net = AtomClassNet()
print(net)
print('\n' + ' -- test: update a test query')
test_query= f"""[...]
CONSTRUCT {{
{atom_class_net.construct(base_node='?node1',
structure='?structureRef',
class_name='?leaf1ConceptLabel')}
{atom_class_net.propagate_relations()}
{net.construct(base_node='?node1',
class_name='system')}
}}
WHERE {{
clause_1
clause_2
{atom_class_net.identify_relations_for_propagation('?node1')}
{net.complete_clauses_for_construction('?node1')}
{atom_class_net.bind_uri('{{node1.concept_label}}',
{net.bind_uri('{{node1.concept_label}}',
'{{node1.variable_label}}')}
}}
"""
......
......@@ -2,7 +2,7 @@
# -*-coding:Utf-8 -*
#==============================================================================
# TENET: Net Query Builder
# TENET: Atom Property Net Query Builder
#------------------------------------------------------------------------------
# Class to generate SPARQL query parts related to semantic nets
#==============================================================================
......@@ -11,65 +11,26 @@
# Importing required modules
#==============================================================================
from net import Net
#==============================================================================
# Data Repository
#==============================================================================
# -- Reference 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',
# 'class_name': 'hasClassName',
# 'mother_class_net': 'hasMotherClassNet',
# '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 '
from .net import Net
#==============================================================================
# Net Class
#==============================================================================
class AtomClassNet(Net):
class AtomPropertyNet(Net):
""" Class to generate SPARQL query parts related to semantic nets.
"""
predicate_table = Net.predicate_table
predicate_table.update({
'class_name': 'hasClassName'
'core_role': 'isCoreRoleLinked',
'target_argument_node': 'targetArgumentNode',
'property_type': 'hasPropertyType',
'property_name': 'hasPropertyName',
'property_name01': 'hasPropertyName01',
'property_name10': 'hasPropertyName10',
'property_name12': 'hasPropertyName12'
})
#--------------------------------------------------------------------------
......@@ -81,8 +42,8 @@ class AtomClassNet(Net):
super().__init__(num)
# -- Net Signature
self.type_name = 'atomClass'
self.type_id = 'Atom_Class_Net'
self.type_name = 'atomProperty'
self.type_id = 'Atom_Property_Net'
self.id = f'?{self.type_name}Net{num}'
self.type_uri = f'net:{self.type_id}'
......@@ -92,15 +53,6 @@ class AtomClassNet(Net):
self.individual_label = f'{self.id}IndividualLabel'
#--------------------------------------------------------------------------
# Private data accessor(s)
#--------------------------------------------------------------------------
# def __get_predicate(self, data_ref):
# property_name = PREDICATE_TABLE[f'{data_ref}']
# return f'net:{property_name}'
#--------------------------------------------------------------------------
# Method(s) to build 'Construct' parts
#--------------------------------------------------------------------------
......@@ -114,8 +66,7 @@ class AtomClassNet(Net):
# Method(s) to build 'Clause' parts
#--------------------------------------------------------------------------
# --
#--------------------------------------------------------------------------
......
......@@ -2,7 +2,7 @@
# -*-coding:Utf-8 -*
#==============================================================================
# TENET: Net Query Builder
# TENET: Individual Net Query Builder
#------------------------------------------------------------------------------
# Class to generate SPARQL query parts related to semantic nets
#==============================================================================
......@@ -11,52 +11,7 @@
# Importing required modules
#==============================================================================
from net import Net
#==============================================================================
# Data Repository
#==============================================================================
# -- Reference 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',
# 'class_name': 'hasClassName',
# 'mother_class_net': 'hasMotherClassNet',
# '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 '
from .net import Net
#==============================================================================
......@@ -69,8 +24,7 @@ class IndividualNet(Net):
predicate_table = Net.predicate_table
predicate_table.update({
'class_name': 'hasClassName',
'mother_class_net': 'hasMotherClassNet',
'mother_class_net': 'hasMotherClassName',
'individual_label': 'hasIndividualLabel'
})
......@@ -83,8 +37,8 @@ class IndividualNet(Net):
super().__init__(num)
# -- Net Signature
self.type_name = 'atomClass'
self.type_id = 'Atom_Class_Net'
self.type_name = 'individual'
self.type_id = 'Individual_Net'
self.id = f'?{self.type_name}Net{num}'
self.type_uri = f'net:{self.type_id}'
......@@ -94,15 +48,6 @@ class IndividualNet(Net):
self.individual_label = f'{self.id}IndividualLabel'
#--------------------------------------------------------------------------
# Private data accessor(s)
#--------------------------------------------------------------------------
# def __get_predicate(self, data_ref):
# property_name = PREDICATE_TABLE[f'{data_ref}']
# return f'net:{property_name}'
#--------------------------------------------------------------------------
# Method(s) to build 'Construct' parts
#--------------------------------------------------------------------------
......@@ -116,8 +61,7 @@ class IndividualNet(Net):
# Method(s) to build 'Clause' parts
#--------------------------------------------------------------------------
# --
#--------------------------------------------------------------------------
......@@ -141,28 +85,19 @@ if __name__ == '__main__':
net = IndividualNet()
print(net)
print('\n' + ' -- test: construct')
construct_ctr = net.construct(base_node='?node1',
structure='?structureRef',
class_name='?leaf1ConceptLabel')
print(construct_ctr)
print('\n' + ' -- test: update a test query')
test_query= f"""[...]
CONSTRUCT {{
{net.construct(base_node='?node1',
structure='?structureRef',
class_name='?leaf1ConceptLabel')}
{net.propagate_relations()}
mother_class_net='?classNet',
individual_label='?valueLabel')}
}}
WHERE {{
clause_1
clause_2
{net.identify_relations_for_propagation('?node1')}
{net.complete_clauses_for_construction('?node1')}
{net.bind_uri('{{node1.concept_label}}',
'{{node1.variable_label}}')}
......
......@@ -18,47 +18,12 @@
# Data Repository
#==============================================================================
# -- Reference 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',
# 'class_name': 'hasClassName',
# 'mother_class_net': 'hasMotherClassNet',
# '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)
DEFAULT_ATTRIBUTE_VALUE = f'\"NA\"'
INDENT_STR = ' '
#==============================================================================
# Net Class
#==============================================================================
......@@ -220,7 +185,7 @@ if __name__ == '__main__':
print('\n' + ' *** Development Test ***')
print('\n' + ' -- test: Atom Class Net')
print('\n' + ' -- test: Net')
net = Net()
print(net)
......
#!/usr/bin/python3.10
# -*-coding:Utf-8 -*
#==============================================================================
# TENET: Net Query Builder
#------------------------------------------------------------------------------
# Class to generate SPARQL query parts related to semantic nets
#==============================================================================
#==============================================================================
# Importing required modules
#==============================================================================
# --
#==============================================================================
# Data Repository
#==============================================================================
# -- Reference 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',
'class_name': 'hasClassName',
'mother_class_net': 'hasMotherClassNet',
'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 '
#==============================================================================
# Net Class
#==============================================================================
class OldNet:
""" Class to generate SPARQL query parts related to semantic nets.
"""
#--------------------------------------------------------------------------
# Constructor(s)
#--------------------------------------------------------------------------
def __init__(self, type_name='default', num=''):
# -- Net Signature
self.id = f'?{type_name}Net{num}'
self.type_name = type_name
self.type_uri = f'net:{NET_TYPE_TABLE[type_name]}'
# -- Net Attributes
self.base_node = f'{self.id}BaseNode'
self.structure = f'{self.id}Structure'
self.class_name = f'{self.id}ClassName'
self.mother_class_net = f'{self.id}MotherClassNet'
self.individual_label = f'{self.id}IndividualLabel'
# -- Private elements (for relation propagation)
self._in_relation_role = f'{self.id}InRelationRole'
self._in_net = f'{self.id}InNet'
self._out_relation_role = f'{self.id}OutRelationRole'
self._out_net = f'{self.id}OutNet'
#--------------------------------------------------------------------------
# Private data accessor(s)
#--------------------------------------------------------------------------
def __get_predicate(self, data_ref):
property_name = PREDICATE_TABLE[f'{data_ref}']
return f'net:{property_name}'
#--------------------------------------------------------------------------
# Method(s) to build 'Construct' parts
#--------------------------------------------------------------------------
def __construct_attribute_triples(self, **net_attribute):
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}"
return result_triples
def construct(self, base_node, **net_attribute):
return f"""
# -- New Net
{self.id} a {self.type_uri}.
{self.id} net:coverBaseNode {base_node}.
{self.__construct_attribute_triples(**net_attribute)}"""
def propagate_relations(self):
return f"""
# -- Propagation of relations (from nodes to nets)
{self._in_relation_role} a net:Relation.
{self._in_net} {self._in_relation_role} {self.id}.
{self._out_relation_role} a net:Relation.
{self.id} {self._out_relation_role} {self._out_net}."""
#--------------------------------------------------------------------------
# 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 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})."""
#==============================================================================
# Development Test
#==============================================================================
if __name__ == '__main__':
print('\n' + ' *** Development Test ***')
print('\n' + ' -- test: Atom Class Net')
atom_class_net = Net('atomClass')
print(atom_class_net)
print('\n' + ' -- test: construct')
construct_ctr = atom_class_net.construct('?node1',
structure='?structureRef',
class_name='?leaf1ConceptLabel')
print(construct_ctr)
print('\n' + ' -- test: update a test query')
test_query= f"""[...]
CONSTRUCT {{
{atom_class_net.construct('?node1',
structure='?structureRef',
class_name='?leaf1ConceptLabel')}
{atom_class_net.propagate_relations()}
}}
WHERE {{
clause_1
clause_2
{atom_class_net.identify_relations_for_propagation('?node1')}
{atom_class_net.bind_uri('{{node1.concept_label}}',
'{{node1.variable_label}}')}
}}
"""
print(test_query)
print('\n' + ' *** - ***')
......@@ -2,7 +2,7 @@
# -*-coding:Utf-8 -*
#==============================================================================
# TENET: Net Query Builder
# TENET: Phenomena Net Query Builder
#------------------------------------------------------------------------------
# Class to generate SPARQL query parts related to semantic nets
#==============================================================================
......@@ -11,65 +11,21 @@
# Importing required modules
#==============================================================================
from net import Net
#==============================================================================
# Data Repository
#==============================================================================
# -- Reference 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',
# 'class_name': 'hasClassName',
# 'mother_class_net': 'hasMotherClassNet',
# '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 '
from .net import Net
#==============================================================================
# Net Class
#==============================================================================
class AtomClassNet(Net):
class PhenomenaNet(Net):
""" Class to generate SPARQL query parts related to semantic nets.
"""
predicate_table = Net.predicate_table
predicate_table.update({
'class_name': 'hasClassName'
'phenomena_type': 'hasPhenomenaType',
'phenomena_ref': 'hasPhenomenaRef'
})
#--------------------------------------------------------------------------
......@@ -81,8 +37,8 @@ class AtomClassNet(Net):
super().__init__(num)
# -- Net Signature
self.type_name = 'atomClass'
self.type_id = 'Atom_Class_Net'
self.type_name = 'phenomena'
self.type_id = 'Phenomena_Net'
self.id = f'?{self.type_name}Net{num}'
self.type_uri = f'net:{self.type_id}'
......@@ -92,15 +48,6 @@ class AtomClassNet(Net):
self.individual_label = f'{self.id}IndividualLabel'
#--------------------------------------------------------------------------
# Private data accessor(s)
#--------------------------------------------------------------------------
# def __get_predicate(self, data_ref):
# property_name = PREDICATE_TABLE[f'{data_ref}']
# return f'net:{property_name}'
#--------------------------------------------------------------------------
# Method(s) to build 'Construct' parts
#--------------------------------------------------------------------------
......@@ -114,8 +61,7 @@ class AtomClassNet(Net):
# Method(s) to build 'Clause' parts
#--------------------------------------------------------------------------
# --
#--------------------------------------------------------------------------
......
#!/usr/bin/python3.10
# -*-coding:Utf-8 -*
#==============================================================================
# TENET: Structure Query Builder
#------------------------------------------------------------------------------
# Class to generate SPARQL query parts related to structure
#==============================================================================
#==============================================================================
# Importing required modules
#==============================================================================
# --
#==============================================================================
# Data Repository
#==============================================================================
# -- Reference 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',
'class_name': 'hasClassName',
'mother_class_net': 'hasMotherClassNet',
'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 '
#==============================================================================
# Net Class
#==============================================================================
class Structure:
""" Class to generate SPARQL query parts related to structure.
"""
#--------------------------------------------------------------------------
# Constructor(s)
#--------------------------------------------------------------------------
def __init__(self):
# -- Structure Attribute(s)
self.sentence_ref = f'?sentenceRef'
#--------------------------------------------------------------------------
# Method(s) to build 'Clause' parts
#--------------------------------------------------------------------------
def identify(self):
return f"""
# -- Identify structure
?root a amr:AMR_Root.
?root amr:hasSentenceID ?sentenceRef.
"""
#==============================================================================
# Development Test
#==============================================================================
if __name__ == '__main__':
print('\n' + ' *** Development Test ***')
print('\n' + ' -- test: Atom Class Net')
structure = Structure()
print(structure)
print('\n' + ' -- test: update a test query')
test_query= f"""[...]
CONSTRUCT {{
[{{atom_class_net.construct('?node1',
structure={structure.sentence_ref},
class_name='?leaf1ConceptLabel')}}
}}
WHERE {{
clause_1
clause_2
{structure.identify()}
}}
"""
print(test_query)
print('\n' + ' *** - ***')
\ No newline at end of file
......@@ -187,9 +187,9 @@ main_generation_sequence = {
'comment': 'Main generation sequence',
'rule_key_list': ['compute-uri-for-owl-declaration-1',
'compute-uri-for-owl-declaration-2',
'compute-uri-for-owl-declaration-3',
'compute-uri-for-owl-declaration-4',
'compute-uri-for-owl-declaration-5',
'compute-uri-for-owl-declaration-6',
'generate-atom-class',
'classify-atom-class-1',
'classify-atom-class-2',
......
......@@ -23,8 +23,8 @@
----- CTS directory: ./structure/cts/
----- target frame directory: ./input/targetFrameStructure/
----- input document directory: ./input/amrDocuments/
----- output directory: ./output/SolarSystemDev1-20221216/
----- sentence output directory: ./output/SolarSystemDev1-20221216/
----- output directory: ./output/SolarSystemDev1-20221219/
----- sentence output directory: ./output/SolarSystemDev1-20221219/
----- SHACL binary directory: ./lib/shacl-1.3.2/bin
-- Config File Definition
----- schema file: ./structure/amr-rdf-schema.ttl
......@@ -44,9 +44,9 @@
----- frame ontology seed file: ./input/targetFrameStructure/base-ontology-seed.ttl
-- Output
----- ontology namespace: https://tenet.tetras-libre.fr/base-ontology/
----- output file: ./output/SolarSystemDev1-20221216/SolarSystemDev1.ttl
----- output file: ./output/SolarSystemDev1-20221219/SolarSystemDev1.ttl
*** - ***
- INFO - -- Creating output target directory: ./output/SolarSystemDev1-20221216/
- INFO - -- Creating output target directory: ./output/SolarSystemDev1-20221219/
- DEBUG - -- Counting number of graph files (sentences)
- DEBUG - ----- Graph count: 1
- INFO - === Extraction Processing using New TENET Engine ===
......@@ -64,13 +64,13 @@
- DEBUG - ----- Sentence Loading
- DEBUG - -------- ./input/amrDocuments/dev/solar-system-1/SSC-01-01.stog.amr.ttl (614)
- DEBUG - --- Export work graph as turtle
- DEBUG - ----- Work graph file: ./output/SolarSystemDev1-20221216/SolarSystemDev1-1/SolarSystemDev1.ttl
- DEBUG - ----- Work graph file: ./output/SolarSystemDev1-20221219/SolarSystemDev1-1/SolarSystemDev1.ttl
- DEBUG - --- Ending Structure Preparation
- DEBUG - ----- Total Execution Time = 0:00:00.101997
- DEBUG - ----- Total Execution Time = 0:00:00.111868
- INFO - -- Loading Extraction Scheme (amr_scheme_1)
- DEBUG - ----- Step number: 3
- INFO - -- Loading Extraction Rules (amr_ctr/*)
- DEBUG - ----- Total rule number: 88
- DEBUG - ----- Total rule number: 87
- INFO - -- Applying extraction step: preprocessing
- INFO - --- Sequence: amrld-correcting-sequence
- INFO - ----- fix-amr-bug-about-system-solar-planet: 5/5 new triples (619)
......@@ -95,133 +95,133 @@
- DEBUG - --- Serializing graph to SolarSystemDev1_preprocessing
- DEBUG - ----- step: preprocessing
- DEBUG - ----- id: SolarSystemDev1
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221216/SolarSystemDev1-1/SolarSystemDev1_preprocessing.ttl
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221219/SolarSystemDev1-1/SolarSystemDev1_preprocessing.ttl
- DEBUG - ----- base: http://SolarSystemDev1/preprocessing
- INFO - ----- 212 triples extracted during preprocessing step
- INFO - -- Applying extraction step: transduction
- INFO - --- Sequence: atomic-extraction-sequence
- INFO - ----- create-atom-class-net: 20/20 new triples (846)
- DEBUG - ----- (refinement) refine-cover-node-1: 5 new triples (851)
- DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (856)
- INFO - ----- create-individual-net-1: 17/17 new triples (873)
- DEBUG - ----- (refinement) refine-cover-node-1: 1 new triples (874)
- INFO - ----- create-atom-property-net-1: 99/99 new triples (973)
- DEBUG - ----- (refinement) refine-cover-node-1: 6 new triples (979)
- INFO - ----- create-phenomena-net-1: 40/41 new triples (1019)
- DEBUG - ----- (refinement) refine-cover-node-1: 2 new triples (1021)
- INFO - ----- create-atom-class-net: 75/75 new triples (901)
- DEBUG - ----- (refinement) refine-cover-node-1: 5 new triples (906)
- DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (911)
- INFO - ----- create-individual-net-1: 17/17 new triples (928)
- DEBUG - ----- (refinement) refine-cover-node-1: 1 new triples (929)
- INFO - ----- create-atom-property-net-1: 99/99 new triples (1028)
- DEBUG - ----- (refinement) refine-cover-node-1: 6 new triples (1034)
- INFO - ----- create-phenomena-net-1: 38/39 new triples (1072)
- DEBUG - ----- (refinement) refine-cover-node-1: 2 new triples (1074)
- INFO - --- Sequence: atomic-extraction-sequence
- INFO - ----- create-atom-class-net: 1/34 new triples (1022)
- DEBUG - ----- create-individual-net-1: 0/17 new triples (1022)
- INFO - ----- create-atom-property-net-1: 1/106 new triples (1023)
- DEBUG - ----- create-phenomena-net-1: 0/41 new triples (1023)
- INFO - ----- create-atom-class-net: 1/89 new triples (1075)
- DEBUG - ----- create-individual-net-1: 0/17 new triples (1075)
- INFO - ----- create-atom-property-net-1: 1/106 new triples (1076)
- DEBUG - ----- create-phenomena-net-1: 0/39 new triples (1076)
- INFO - --- Sequence: phenomena-checking-sequence
- INFO - ----- expand-and-conjunction-phenomena-net: 4/4 new triples (1027)
- DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (1027)
- DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (1027)
- DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (1027)
- DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (1027)
- DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (1027)
- DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (1027)
- INFO - ----- expand-and-conjunction-phenomena-net: 4/4 new triples (1080)
- DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (1080)
- DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (1080)
- DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (1080)
- DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (1080)
- DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (1080)
- DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (1080)
- INFO - --- Sequence: composite-property-extraction-sequence
- DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (1027)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1027)
- DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (1080)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1080)
- INFO - --- Sequence: composite-class-extraction-sequence-1
- INFO - ----- create-composite-class-net-from-property-1: 75/79 new triples (1102)
- DEBUG - ----- (refinement) refine-cover-node-1: 12 new triples (1114)
- DEBUG - ----- (refinement) refine-cover-node-2: 4 new triples (1118)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1118)
- DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1118)
- INFO - ----- create-composite-class-net-from-property-1: 75/79 new triples (1155)
- DEBUG - ----- (refinement) refine-cover-node-1: 12 new triples (1167)
- DEBUG - ----- (refinement) refine-cover-node-2: 4 new triples (1171)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1171)
- DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1171)
- INFO - --- Sequence: composite-class-extraction-sequence-2
- DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1118)
- DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1118)
- DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1118)
- DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1118)
- DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1171)
- DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1171)
- DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1171)
- DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1171)
- INFO - --- Sequence: phenomena-checking-sequence
- INFO - ----- expand-and-conjunction-phenomena-net: 1/5 new triples (1119)
- DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (1119)
- DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (1119)
- DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (1119)
- DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (1119)
- DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (1119)
- DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (1119)
- INFO - ----- expand-and-conjunction-phenomena-net: 1/5 new triples (1172)
- DEBUG - ----- expand-degree-phenomena-net-1: 0/0 new triples (1172)
- DEBUG - ----- expand-degree-phenomena-net-2: 0/0 new triples (1172)
- DEBUG - ----- expand-degree-phenomena-net-3: 0/0 new triples (1172)
- DEBUG - ----- expand-degree-phenomena-net-4: 0/0 new triples (1172)
- DEBUG - ----- expand-degree-phenomena-net-5: 0/0 new triples (1172)
- DEBUG - ----- expand-degree-phenomena-net-6: 0/0 new triples (1172)
- INFO - --- Sequence: composite-property-extraction-sequence
- DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (1119)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1119)
- DEBUG - ----- create-composite-class-net-from-property-1: 0/0 new triples (1172)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1172)
- INFO - --- Sequence: composite-class-extraction-sequence-1
- INFO - ----- create-composite-class-net-from-property-1: 94/173 new triples (1213)
- DEBUG - ----- (refinement) refine-cover-node-1: 15 new triples (1228)
- DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (1233)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1233)
- DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1233)
- INFO - ----- create-composite-class-net-from-property-1: 94/173 new triples (1266)
- DEBUG - ----- (refinement) refine-cover-node-1: 15 new triples (1281)
- DEBUG - ----- (refinement) refine-cover-node-2: 5 new triples (1286)
- DEBUG - ----- create-composite-class-net-from-property-2: 0/0 new triples (1286)
- DEBUG - ----- create-composite-class-net-from-property-3: 0/0 new triples (1286)
- INFO - --- Sequence: composite-class-extraction-sequence-2
- DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1233)
- DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1233)
- DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1233)
- DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1233)
- DEBUG - ----- create-composite-class-net-from-phenomena-1: 0/0 new triples (1286)
- DEBUG - ----- create-composite-class-net-from-phenomena-2: 0/0 new triples (1286)
- DEBUG - ----- create-composite-class-net-from-phenomena-3: 0/0 new triples (1286)
- DEBUG - ----- create-composite-class-net-from-phenomena-4: 0/0 new triples (1286)
- INFO - --- Sequence: restriction-adding-sequence
- DEBUG - ----- add-restriction-to-class-net-from-property-1: 0/0 new triples (1233)
- DEBUG - ----- add-restriction-to-class-net-from-property-1: 0/0 new triples (1286)
- INFO - --- Sequence: classification-sequence
- INFO - ----- classify-net-from-core-1: 12/12 new triples (1245)
- INFO - ----- classify-net-from-core-2: 1/9 new triples (1246)
- DEBUG - ----- classify-net-from-core-3: 0/0 new triples (1246)
- DEBUG - ----- classify-net-from-mod: 0/0 new triples (1246)
- DEBUG - ----- classify-net-from-part: 0/0 new triples (1246)
- INFO - ----- classify-net-from-domain: 6/6 new triples (1252)
- DEBUG - ----- classify-net-from-degree-phenomena-1: 0/0 new triples (1252)
- DEBUG - ----- classify-net-from-degree-phenomena-2: 0/0 new triples (1252)
- DEBUG - ----- classify-net-from-degree-phenomena-3: 0/0 new triples (1252)
- DEBUG - ----- propagate-individual-1: 0/1 new triples (1252)
- INFO - ----- propagate-individual-2: 6/6 new triples (1258)
- DEBUG - ----- reclassify-deprecated-net: 0/0 new triples (1258)
- INFO - ----- classify-net-from-core-1: 12/12 new triples (1298)
- INFO - ----- classify-net-from-core-2: 1/9 new triples (1299)
- DEBUG - ----- classify-net-from-core-3: 0/0 new triples (1299)
- DEBUG - ----- classify-net-from-mod: 0/0 new triples (1299)
- DEBUG - ----- classify-net-from-part: 0/0 new triples (1299)
- INFO - ----- classify-net-from-domain: 6/6 new triples (1305)
- DEBUG - ----- classify-net-from-degree-phenomena-1: 0/0 new triples (1305)
- DEBUG - ----- classify-net-from-degree-phenomena-2: 0/0 new triples (1305)
- DEBUG - ----- classify-net-from-degree-phenomena-3: 0/0 new triples (1305)
- INFO - ----- propagate-individual-1: 1/1 new triples (1306)
- INFO - ----- propagate-individual-2: 6/6 new triples (1312)
- DEBUG - ----- reclassify-deprecated-net: 0/0 new triples (1312)
- DEBUG - --- Serializing graph to SolarSystemDev1_transduction
- DEBUG - ----- step: transduction
- DEBUG - ----- id: SolarSystemDev1
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221216/SolarSystemDev1-1/SolarSystemDev1_transduction.ttl
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221219/SolarSystemDev1-1/SolarSystemDev1_transduction.ttl
- DEBUG - ----- base: http://SolarSystemDev1/transduction
- INFO - ----- 432 triples extracted during transduction step
- INFO - ----- 486 triples extracted during transduction step
- INFO - -- Applying extraction step: generation
- INFO - --- Sequence: main-generation-sequence
- INFO - ----- compute-uri-for-owl-declaration-1: 14/14 new triples (1272)
- INFO - ----- compute-uri-for-owl-declaration-2: 1/1 new triples (1273)
- DEBUG - ----- compute-uri-for-owl-declaration-4: 0/0 new triples (1273)
- INFO - ----- compute-uri-for-owl-declaration-5: 6/6 new triples (1279)
- INFO - ----- compute-uri-for-owl-declaration-6: 6/6 new triples (1285)
- INFO - ----- generate-atom-class: 12/12 new triples (1297)
- INFO - ----- classify-atom-class-1: 4/4 new triples (1301)
- INFO - ----- classify-atom-class-2: 1/1 new triples (1302)
- INFO - ----- generate-individual: 3/3 new triples (1305)
- INFO - ----- classify-individual: 6/6 new triples (1311)
- INFO - ----- generate-atom-property-1: 20/20 new triples (1331)
- INFO - ----- generate-atom-property-12: 12/20 new triples (1343)
- DEBUG - ----- generate-inverse-relation: 0/0 new triples (1343)
- INFO - ----- generate-composite-class: 38/38 new triples (1381)
- DEBUG - ----- add-restriction-to-class-1: 0/0 new triples (1381)
- DEBUG - ----- add-restriction-to-class-2: 0/0 new triples (1381)
- INFO - ----- add-restriction-to-class-3: 36/45 new triples (1417)
- DEBUG - ----- add-restriction-to-class-4: 0/0 new triples (1417)
- DEBUG - ----- add-restriction-to-class-5: 0/0 new triples (1417)
- DEBUG - ----- add-restriction-to-class-6: 0/0 new triples (1417)
- DEBUG - ----- generate-composite-property: 0/0 new triples (1417)
- INFO - ----- compute-uri-for-owl-declaration-1: 14/14 new triples (1326)
- INFO - ----- compute-uri-for-owl-declaration-2: 1/1 new triples (1327)
- DEBUG - ----- compute-uri-for-owl-declaration-3: 0/0 new triples (1327)
- INFO - ----- compute-uri-for-owl-declaration-4: 6/6 new triples (1333)
- INFO - ----- compute-uri-for-owl-declaration-5: 6/6 new triples (1339)
- INFO - ----- generate-atom-class: 12/12 new triples (1351)
- INFO - ----- classify-atom-class-1: 4/4 new triples (1355)
- INFO - ----- classify-atom-class-2: 1/1 new triples (1356)
- INFO - ----- generate-individual: 3/3 new triples (1359)
- INFO - ----- classify-individual: 6/6 new triples (1365)
- INFO - ----- generate-atom-property-1: 20/20 new triples (1385)
- INFO - ----- generate-atom-property-12: 12/20 new triples (1397)
- DEBUG - ----- generate-inverse-relation: 0/0 new triples (1397)
- INFO - ----- generate-composite-class: 38/38 new triples (1435)
- DEBUG - ----- add-restriction-to-class-1: 0/0 new triples (1435)
- DEBUG - ----- add-restriction-to-class-2: 0/0 new triples (1435)
- INFO - ----- add-restriction-to-class-3: 36/45 new triples (1471)
- DEBUG - ----- add-restriction-to-class-4: 0/0 new triples (1471)
- DEBUG - ----- add-restriction-to-class-5: 0/0 new triples (1471)
- DEBUG - ----- add-restriction-to-class-6: 0/0 new triples (1471)
- DEBUG - ----- generate-composite-property: 0/0 new triples (1471)
- DEBUG - --- Serializing graph to SolarSystemDev1_generation
- DEBUG - ----- step: generation
- DEBUG - ----- id: SolarSystemDev1
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221216/SolarSystemDev1-1/SolarSystemDev1_generation.ttl
- DEBUG - ----- work_file: ./output/SolarSystemDev1-20221219/SolarSystemDev1-1/SolarSystemDev1_generation.ttl
- DEBUG - ----- base: http://SolarSystemDev1/generation
- INFO - ----- 159 triples extracted during generation step
- INFO - -- Result: file containing only the factoids
- DEBUG - --- Making factoid graph with the last step result
- DEBUG - ----- Number of factoids: 176
- DEBUG - ----- Graph base: http://SolarSystemDev1/factoid
- DEBUG - --- Serializing graph to factoid file (./output/SolarSystemDev1-20221216/SolarSystemDev1-1/SolarSystemDev1_factoid.ttl)
- DEBUG - --- Serializing graph to factoid file (./output/SolarSystemDev1-20221219/SolarSystemDev1-1/SolarSystemDev1_factoid.ttl)
- INFO -
*** Execution Time ***
----- Function: apply (lib.tenet_extraction)
----- Total Time: 0:00:06.370078
----- Process Time: 0:00:06.357116
----- Total Time: 0:00:06.931846
----- Process Time: 0:00:06.907409
*** - ***
- INFO - === Final Ontology Generation ===
- INFO - -- Making complete factoid graph by merging sentence factoid graphs
- INFO - ----- Total factoid number: 176
- INFO - ----- Graph base: http://SolarSystemDev1/factoid
- INFO - -- Serializing graph to factoid file (./output/SolarSystemDev1-20221216/SolarSystemDev1_factoid.ttl)
- INFO - -- Serializing graph to factoid file (./output/SolarSystemDev1-20221219/SolarSystemDev1_factoid.ttl)
- INFO - === Done ===
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment