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
cubicweb
Commits
50122959acbc
Commit
1fa4c899
authored
Feb 01, 2020
by
Nicolas Chauvat
Browse files
[web/views/rdf] enhance encoding and formats for RDFView
--HG-- branch : 3.27
parent
fa39f3305911
Changes
1
Hide whitespace changes
Inline
Side-by-side
cubicweb/web/views/rdf.py
View file @
50122959
...
...
@@ -48,8 +48,8 @@ if rdflib is not None:
title
=
_
(
'rdf export'
)
templatable
=
False
binary
=
True
format
=
'xml'
content_type
=
'
text/xml'
# +rdf
format
=
'xml'
# or maybe pretty-xml ?
content_type
=
'
application/rdf+xml'
def
call
(
self
):
graph
=
rdflib
.
Graph
()
...
...
@@ -104,6 +104,26 @@ if rdflib is not None:
class
RDFN3View
(
RDFView
):
__regid__
=
'
n3
rdf'
__regid__
=
'rdf
.n3
'
format
=
'n3'
content_type
=
'text/n3'
content_type
=
'text/n3'
# see https://www.w3.org/TeamSubmission/n3/#mimetype
class
RDFTurtleView
(
RDFView
):
__regid__
=
'rdf.turtle'
format
=
'turtle'
content_type
=
'text/turtle'
# see https://www.w3.org/TR/turtle/#sec-mediaReg
class
RDFnquadsView
(
RDFView
):
__regid__
=
'rdf.nquads'
format
=
'nquads'
content_type
=
'application/n-quads'
# see https://www.w3.org/TR/n-quads/#sec-mediatype
class
RDFntriplesView
(
RDFView
):
__regid__
=
'rdf.nt'
format
=
'nt'
content_type
=
'application/n-triples'
# see https://www.w3.org/TR/n-triples/#n-triples-mediatype
class
RDFtrigView
(
RDFView
):
__regid__
=
'rdf.trig'
format
=
'trig'
content_type
=
'application/trig'
# see https://www.w3.org/TR/trig/#sec-mime
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