Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
cubicweb
OWL2YAMS
Commits
30acc414a3c7
Commit
30acc414
authored
Nov 25, 2021
by
Élodie Thiéblin
Browse files
feat: update queries to import DCterms
parent
f8ce72703882
Changes
1
Hide whitespace changes
Inline
Side-by-side
owl2yams/__init__.py
View file @
30acc414
...
...
@@ -38,7 +38,7 @@
def
fragment_from_uri
(
uri
:
str
,
titling
=
False
)
->
Optional
[
str
]:
if
uri
==
OWL
.
Thing
:
if
uri
==
OWL
.
Thing
or
uri
==
RDFS
.
Class
:
return
None
url
=
urlparse
(
uri
)
# if url.fragment is not None, the fragment is done with `#`
...
...
@@ -97,6 +97,7 @@
{?uri a owl:Class}
UNION {?rangeprop rdfs:range ?uri.}
UNION {?domainprop rdfs:domain ?uri.}
UNION{?uri a rdfs:Class.}
}
"""
...
...
@@ -134,6 +135,7 @@
datatype_property_query
=
"""
PREFIX owl: <http://www.w3.org/2002/07/owl#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT DISTINCT ?uri WHERE {
{?uri a owl:DatatypeProperty}
UNION {?uri a owl:AnnotationProperty.}
...
...
@@ -137,6 +139,8 @@
SELECT DISTINCT ?uri WHERE {
{?uri a owl:DatatypeProperty}
UNION {?uri a owl:AnnotationProperty.}
UNION {?uri rdfs:range ?z.
FILTER (?z in (xsd:int, rdfs:Literal, xsd:date, xsd:float, xsd:integer))}
}
"""
for
datatype_property_res
in
owl_model
.
query
(
datatype_property_query
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment