Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
upnd
rcf-sparnatural
Commits
1ab132c64d8a
Commit
8788153a
authored
Feb 03, 2021
by
Élodie Thiéblin
Browse files
feat: add singlefield sparnatural interrogation
parent
797209e7e9cd
Changes
3
Hide whitespace changes
Inline
Side-by-side
rcfexpense_sparnatural.ttl
View file @
1ab132c6
...
...
@@ -13,11 +13,22 @@
# Object Properties
#################################################################
### http://rcfexpense.logilab.fr/fieldLabel
:
fieldLabel
rdf:
type
owl:
ObjectProperty
;
rdfs:
subPropertyOf
<http://data.sparna.fr/ontologies/sparnatural-config-core#SearchProperty>
;
rdfs:
domain
:
SingleField
;
rdfs:
range
:
Search
;
<http://data.sparna.fr/ontologies/sparnatural-config-core#sparqlString>
"<http://rcfexpense.logilab.fr/name>"
;
rdfs:
label
"contient"
@fr
.
### http://rcfexpense.logilab.fr/hasField
:
hasField
rdf:
type
owl:
ObjectProperty
;
rdfs:
subPropertyOf
owl:
topObjectProperty
;
rdfs:
domain
:
Page
;
rdfs:
range
:
Field
.
rdfs:
range
:
SingleField
;
<http://data.sparna.fr/ontologies/sparnatural-config-core#sparqlString>
"<http://rcfexpense.logilab.fr/hasField>"
@fr
;
rdfs:
label
"contient le champ"
@fr
.
### http://rcfexpense.logilab.fr/hasMultipleField
...
...
@@ -45,9 +56,12 @@
### http://rcfexpense.logilab.fr/hasSingleField
:
hasSingleField
rdf:
type
owl:
ObjectProperty
;
rdfs:
subPropertyOf
:
hasField
;
rdfs:
subPropertyOf
<http://data.sparna.fr/ontologies/sparnatural-config-core#NonSelectableProperty>
,
:
hasField
;
rdfs:
domain
:
Page
;
rdfs:
range
:
SingleField
.
rdfs:
range
:
SingleField
;
<http://data.sparna.fr/ontologies/sparnatural-config-core#sparqlString>
"<http://rcfexpense.logilab.fr/hasSingleField>"
;
rdfs:
label
"contient"
@fr
.
### http://rcfexpense.logilab.fr/hasSubField
...
...
@@ -93,6 +107,15 @@
rdfs:
label
"est dans le registre"
@fr
.
### http://rcfexpense.logilab.fr/isSingleFieldOfPage
:
isSingleFieldOfPage
rdf:
type
owl:
ObjectProperty
;
rdfs:
subPropertyOf
<http://data.sparna.fr/ontologies/sparnatural-config-core#AutocompleteProperty>
;
rdfs:
domain
:
SingleField
;
rdfs:
range
:
Page
;
<http://data.sparna.fr/ontologies/sparnatural-config-core#sparqlString>
"^<http://rcfexpense.logilab.fr/hasSingleField>"
;
rdfs:
label
"est dans"
@fr
.
### http://rcfexpense.logilab.fr/registerIsInSeason
:
registerIsInSeason
rdf:
type
owl:
ObjectProperty
;
rdfs:
subPropertyOf
<http://data.sparna.fr/ontologies/sparnatural-config-core#TimeProperty-Year>
;
...
...
@@ -175,7 +198,9 @@
#################################################################
### http://rcfexpense.logilab.fr/Field
:
Field
rdf:
type
owl:
Class
.
:
Field
rdf:
type
owl:
Class
;
<http://data.sparna.fr/ontologies/sparnatural-config-core#faIcon>
"fas fa-money-bill-alt"
;
rdfs:
label
"Champ"
@fr
.
### http://rcfexpense.logilab.fr/MultipleField
...
...
@@ -209,6 +234,13 @@
rdfs:
label
"Registre"
@fr
.
### http://rcfexpense.logilab.fr/Search
:
Search
rdf:
type
owl:
Class
;
rdfs:
subClassOf
<http://data.sparna.fr/ontologies/sparnatural-config-core#SparnaturalClass>
;
<http://data.sparna.fr/ontologies/sparnatural-config-core#faIcon>
"fas fa-search"
;
rdfs:
label
"Rechercher"
@fr
.
### http://rcfexpense.logilab.fr/Season
:
Season
rdf:
type
owl:
Class
;
rdfs:
subClassOf
<http://data.sparna.fr/ontologies/sparnatural-config-core#SparnaturalClass>
;
...
...
@@ -218,11 +250,21 @@
### http://rcfexpense.logilab.fr/SingleField
:
SingleField
rdf:
type
owl:
Class
;
rdfs:
subClassOf
:
Field
.
rdfs:
subClassOf
<http://data.sparna.fr/ontologies/sparnatural-config-core#SparnaturalClass>
,
:
Field
;
<http://data.sparna.fr/ontologies/sparnatural-config-core#faIcon>
"fas fa-money-bill-alt"
;
rdfs:
label
"Champ simple"
@fr
.
### http://rcfexpense.logilab.fr/Value
:
Value
rdf:
type
owl:
Class
.
#################################################################
# Annotations
#################################################################
rdfs:
Literal
<http://data.sparna.fr/ontologies/sparnatural-config-core#faIcon>
"fas fa-search"
.
### Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi
src/QueryGenerators.js
View file @
1ab132c6
...
...
@@ -207,8 +207,8 @@ class DefaultQueryGenerator {
}
break
;
case
Config
.
SEARCH_PROPERTY
:
var
searchKey
=
component
.
CriteriaGroup
.
EndClassWidgetGroup
.
selectedValues
[
0
]
;
jsonFilter
=
this
.
initFilterSearch
(
searchKey
,
objectVariable
)
;
var
searchKey
=
component
.
CriteriaGroup
.
EndClassWidgetGroup
.
selectedValues
[
0
]
;
var
jsonFilter
=
this
.
initFilterSearch
(
searchKey
,
objectVariable
)
;
jsonQuery
.
where
.
push
(
jsonFilter
)
;
break
;
case
Config
.
GRAPHDB_SEARCH_PROPERTY
:
...
...
src/index.html
View file @
1ab132c6
...
...
@@ -220,6 +220,14 @@
};
rdfsLabelPostProcess
=
function
(
queryString
,
queryJson
)
{
if
(
queryString
.
indexOf
(
"
?this rdf:type <http://rcfexpense.logilab.fr/SingleField>
"
)
!==
-
1
){
queryString
=
queryString
.
replace
(
new
RegExp
(
"
}$
"
),
"
?this <http://rcfexpense.logilab.fr/name> ?nom.
\n
}
"
);
return
queryString
;
}
queryString
=
queryString
.
replace
(
new
RegExp
(
"
}$
"
),
"
?this rdfs:label ?label FILTER(lang(?label) = 'fr')
\n
}
"
...
...
@@ -228,6 +236,25 @@
};
orderByPostProcess
=
function
(
queryString
,
queryJson
)
{
if
(
queryString
.
indexOf
(
"
?this rdf:type <http://rcfexpense.logilab.fr/SingleField>
"
)
!==
-
1
){
queryString
=
queryString
.
replace
(
new
RegExp
(
"
}$
"
),
"
?this ^<http://rcfexpense.logilab.fr/hasSingleField> ?page.
\
?page <http://rcfexpense.logilab.fr/pageNumber> ?numpage.
\
?page ^<http://rcfexpense.logilab.fr/hasPage> ?registeruri.
\
?registeruri rdfs:label ?registre.
\
?this <http://rcfexpense.logilab.fr/hasValue> ?V.
\
?V <http://rcfexpense.logilab.fr/livres> ?livres.
\
?V <http://rcfexpense.logilab.fr/sols> ?sols.
\
?V <http://rcfexpense.logilab.fr/deniers> ?deniers.
\
} LIMIT 5000
"
);
queryString
=
queryString
.
replace
(
"
SELECT DISTINCT ?this
"
,
"
SELECT DISTINCT ?this ?registre ?numpage ?nom ?livres ?sols ?deniers
"
);
return
queryString
;
}
queryString
=
queryString
.
replace
(
new
RegExp
(
"
}$
"
),
"
}
\n
ORDER BY ?label LIMIT 5000
"
...
...
@@ -236,6 +263,7 @@
"
SELECT DISTINCT ?this
"
,
"
SELECT DISTINCT (STR(?label) AS ?nom) ?this
"
);
return
queryString
;
};
...
...
Write
Preview
Markdown
is supported
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