Commit 4611a507 authored by Thorsten Wißmann's avatar Thorsten Wißmann
Browse files

Parse URIs within < >

parent c4abe601
......@@ -185,11 +185,14 @@ let rec tree_of_intree it =
in
Node (tree_list_of_intree it)
let parse_uri (str:string) : OWL.uri =
Str.replace_first (Str.regexp "<\\(.*\\)>") "\\1" str
let parse_prefix a lst : OWL.prefix =
match lst with
| [INode ((str,a),[])] -> (
match split (regexp "=") str with
| [l;r] -> (l,r)
| [l;r] -> (l,parse_uri r)
| _ -> raise (ParseError (a,("Invalid Prefix-Definition")))
)
| _ -> raise (ParseError (a,("Missing Prefix-definition")))
......@@ -257,7 +260,7 @@ let parse_ontology a (axioms:string annotated intree list) : OWL.ontology =
(* the first element of axioms, i.e. of the children of the ontology node
is just the ontology name/uri *)
match axioms with
| (INode ((ontoname,_), [])::axioms) -> (ontoname, L.map parse_axiom axioms)
| (INode ((ontoname,_), [])::axioms) -> (parse_uri ontoname, L.map parse_axiom axioms)
| _ -> raise (ParseError (a,("Missing Ontology name")))
let ap (lref:'a list ref) (el:'a): unit = (* append to 'a list ref *)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment