Beispiel #1
0
def load_ontologies():
    model_uri = 'http://www.egc.org/ont/process/test'
    onto = get_ontology(model_uri)
    onto, shacl, skos, dcterms, props, foaf = OWLUtils.load_common(onto)
    onto, geospatial = OWLUtils.load_geo_vocabl(onto)
    onto, gb, task, data, cyber = OWLUtils.load_common_for_process_tool(onto)
    onto, context = OWLUtils.load_context(onto)
    arcgis = get_ontology('arcgis.owl').load()
    grass = get_ontology('grass.owl').load(only_local=True)
    otb = get_ontology('otb.owl').load(only_local=True)
    saga = get_ontology('saga.owl').load(only_local=True)
    taudem = get_ontology('taudem.owl').load(only_local=True)
    whitebox = get_ontology('whitebox.owl').load(only_local=True)
    print('ontologies loaded')
    return onto, arcgis, grass, saga, otb, taudem, whitebox
Beispiel #2
0
# author: houzhiwei
# time: 2019/1/3 16:04

from owlready2 import *
import json
import re
from JSON2OWL.OwlConvert.OwlUtils import OWLUtils
from JSON2OWL.OwlConvert.Preprocessor import Preprocessor
from rdflib import BNode, RDF, Graph, URIRef, Namespace, Literal
from rdflib.collection import Collection

module_uri = 'http://www.egc.org/ont/process/saga'
onto = get_ontology(module_uri)
# onto, skos, dcterms, props = OWLUtils.load_common(onto)
onto, sh, skos, dcterms, props, foaf = OWLUtils.load_common(onto)
onto, geospatial = OWLUtils.load_geo_vocabl(onto)
onto, gb, task, data, cyber, context = OWLUtils.load_common_for_process_tool(
    onto)
# rdf namespaces
Data, Cyber, Skos, Sh, Geo, Sf, Process = OWLUtils.rdfnamespaces()

print('ontologies imported')

# sh:declare
# TODO TEST
# OWLUtils.declear_prefix('ns_saga', onto)

with onto:
    # print(gb.GeoprocessingFunctionality)

    class SagaTool(gb.GeoprocessingFunctionality):
Beispiel #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: houzhiwei
# time: 2019/4/27 13:23
from owlready2 import *
import json
import re
from JSON2OWL.OwlConvert.OwlUtils import OWLUtils

model_uri = 'http://www.egc.org/ont/process/test'
onto = get_ontology(model_uri)
onto, sh, skos, dcterms, props = OWLUtils.load_common(onto)
onto, gb, task, data, cyber = OWLUtils.load_common_for_process_tool(onto)
onto = OWLUtils.load_geo_vocabl(onto)
# onto, gcmd, csdms, cf, dta, hydrology, gis_vocab = OWLUtils.load_geo_vocabl(onto)
print('ontologies imported')


def search(word):
    word = word  # 含空格
    print(onto.search(prefLabel='*' + word))
    # word = word.replace(' ', '_')
    # print(onto.search(label = "*"+word))


search('lake')