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

dev in progress: uriref_computer

parent 9f12b2d6
Branches
Tags
No related merge requests found
...@@ -14,11 +14,20 @@ from rdflib import URIRef, Graph, RDF, SDO ...@@ -14,11 +14,20 @@ from rdflib import URIRef, Graph, RDF, SDO
from rdflib.term import _is_valid_uri from rdflib.term import _is_valid_uri
#==============================================================================
# Checking Method(s)
#==============================================================================
class InvalidURIRef(Exception): class InvalidURIRef(Exception):
"""Raise when URIs are invalid.""" """Raise when URIs are invalid."""
pass pass
#==============================================================================
# Main Method(s)
#==============================================================================
def create_uriref(uri): def create_uriref(uri):
"""Create a URIRef with the same validation func used by URIRef """Create a URIRef with the same validation func used by URIRef
......
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
#============================================================================== #==============================================================================
import subprocess, os import subprocess, os
from rdflib import Graph from rdflib import Graph, Namespace
from rdflib import Namespace
from rdflib.namespace import NamespaceManager from rdflib.namespace import NamespaceManager
FILE_PATH = f'{os.path.dirname(os.path.abspath(__file__))}' FILE_PATH = f'{os.path.dirname(os.path.abspath(__file__))}'
...@@ -18,11 +17,8 @@ OUTPUT_DIR_PATH = f'{FILE_PATH}/output/' ...@@ -18,11 +17,8 @@ OUTPUT_DIR_PATH = f'{FILE_PATH}/output/'
TEST_GRAPH = f'{INPUT_DIR_PATH}testGraph1.ttl' TEST_GRAPH = f'{INPUT_DIR_PATH}testGraph1.ttl'
from context import tenet from context import tenet
from tenet.febTransduction import phenomena_application_or as test_rule
from tenet.febTransduction import prefix_handle from tenet.febTransduction import prefix_handle
INDENT_STR = ' '
#============================================================================== #==============================================================================
......
#!/usr/bin/python3.10
# -*-coding:Utf-8 -*
#==============================================================================
# TENET: Extraction Rule Test
#------------------------------------------------------------------------------
# Script to test rules under development
#==============================================================================
import subprocess, os
from rdflib import Graph, Namespace
from rdflib.namespace import NamespaceManager
from rdflib.term import _is_valid_uri
FILE_PATH = f'{os.path.dirname(os.path.abspath(__file__))}'
INPUT_DIR_PATH = f'{FILE_PATH}/input/'
OUTPUT_DIR_PATH = f'{FILE_PATH}/output/'
TEST_GRAPH = f'{INPUT_DIR_PATH}testGraph1.ttl'
from context import tenet
from tenet.febTransduction import uriref_computer
#==============================================================================
# Useful Methods
#==============================================================================
# None
#==============================================================================
# Development Test
#==============================================================================
def devtest_check_uri(uri):
print(f'\n -- Test URI checking')
print(f' ----- uri: {uri}')
print(f' ----- check 1: {_is_valid_uri(uri)}')
#==============================================================================
# Unit Test
#==============================================================================
# TODO
#==============================================================================
# Test Script
#==============================================================================
if __name__ == '__main__':
print('\n *** Test Preparation ***')
pass
print('\n \n')
print('\n *** Development Test ***')
devtest_check_uri('<net:compositeClass_orbit_hasManner_conjunction-OR>')
devtest_check_uri('net:compositeClass_orbit_hasManner_conjunction-OR')
print('\n \n')
print('\n *** Unit Test ***')
pass
print('\n \n')
print('\n *** - ***')
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment