Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added rdf steps #258

Merged
merged 1 commit into from
Nov 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 51 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ task make_etc() {
}

[ "steps", "step-file", "step-os", "step-paged-media",
"step-run", "step-text", "step-validation" ].each { spec ->
"step-run", "step-text", "step-rdf", "step-validation" ].each { spec ->
Task t = task "copy_${spec}_build"(dependsOn: [ "buildspecs" ], type: Copy) {
from "$spec/build/"
exclude "xinclude.xml", "examples/**", "graphics/**", "glossary.xml"
Expand Down Expand Up @@ -533,6 +533,56 @@ task step_text_xpl(dependsOn: ["step-text:library"], type: Copy) {
rename ("library.xml", "steps.xpl")
}

// ======================================================================
// step-rdf

task step_rdf(type: DocBookTask,
dependsOn: [ "download_xproc_toc",
"steps", "xproc_schemas", "spec_schemas",
"step-rdf:specification",
"step_rdf_assets",
"step_rdf_src", "step_rdf_xpl" ]) {
inputs.files fileTree(dir: "tools/xsl/")
inputs.files fileTree(dir: "tools/xpl/")
inputs.file "build/xproc_toc.xml"
input("source", "step-rdf/build/source.xml")
output("result", "build/dist/rdf/index.html")

param("schemaext.schema", file("build/schema/dbspec.rng"))
param("travis", getenv("TRAVIS"))
param("travis-commit", getenv("TRAVIS_COMMIT"))
param("travis-build-number", getenv("TRAVIS_BUILD_NUMBER"))
param("travis-user", getenv("TRAVIS_USER"))
param("travis-repo", getenv("TRAVIS_REPO"))
param("travis-branch", getenv("TRAVIS_BRANCH"))
param("travis-tag", getenv("TRAVIS_TAG"))

option("style", file("tools/xsl/xproc-specs.xsl"))
option("diff", deltaxml())

pipeline "tools/xpl/formatspec.xpl"
}
buildspecs.dependsOn "step_rdf"

task step_rdf_assets(type: Copy) {
from "src/main/resources"
into "build/dist/rdf/"
}

task step_rdf_src(dependsOn: ["step-rdf:source"], type: Copy) {
from "step-rdf/build/"
into "build/dist/rdf/"
include "source.xml"
rename ("source.xml", "specification.xml")
}

task step_rdf_xpl(dependsOn: ["step-rdf:library"], type: Copy) {
from "step-rdf/build/"
into "build/dist/rdf/"
include "library.xml"
rename ("library.xml", "steps.xpl")
}

// ======================================================================
// Clean up

Expand Down
2 changes: 1 addition & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
include 'steps', 'step-validation', 'step-os', 'step-paged-media', 'step-run',
'step-file', 'step-text', 'step-json'
'step-file', 'step-text', 'step-json', 'step-rdf'
95 changes: 95 additions & 0 deletions step-rdf/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
repositories {
mavenLocal()
mavenCentral()
}

configurations {
tools {
description = "Run tools"
transitive = true
}
}

dependencies {
tools (
[group: 'org.relaxng', name: 'jing', version: '20181204'],
[group: 'org.relaxng', name: 'trang', version: '20181204']
)
}

defaultTasks 'specification'

apply plugin: 'com.xmlcalabash.task'

import com.xmlcalabash.XMLCalabashTask
import com.nwalsh.tasks.StripAmblesTask

task xinclude(dependsOn: [":spec_schemas"], type: XMLCalabashTask) {
inputs.files fileTree(dir: "src/main/xml/")
outputs.file "build/xinclude.xml"
input("source", "src/main/xml/specification.xml")
output("result", "build/xinclude.xml")
pipeline "../tools/xpl/validate.xpl"
}
xinclude.doFirst {
mkdir("build")
}

task source(dependsOn: ["glossary"], type: XMLCalabashTask) {
inputs.file "../tools/xsl/masterbib.xsl"
inputs.file "../src/main/xml/bibliography.xml"
inputs.file "src/main/xml/specification.xml"
inputs.file "build/glossary.xml"
outputs.file "build/source.xml"
input("source", "src/main/xml/specification.xml")
output("result", "build/source.xml")
pipeline "../tools/xpl/validate.xpl"
}

task glossary(dependsOn: ["xinclude"], type: XMLCalabashTask) {
inputs.file "build/xinclude.xml"
inputs.file "../tools/xpl/makeglossary.xpl"
inputs.file "../tools/xsl/makeglossary.xsl"
outputs.file "build/glossary.xml"
input("source", "build/xinclude.xml")
output("result", "build/glossary.xml")
pipeline "../tools/xpl/makeglossary.xpl"
}

task library(dependsOn: ["source"], type: XMLCalabashTask) {
inputs.file "build/source.xml"
inputs.file "../tools/xpl/typed-pipeline-library.xpl"
inputs.file "../tools/xsl/typed-pipeline-library.xsl"
outputs.file "build/library.xml"
input("source", "build/source.xml")
output("result", "build/library.xml")
pipeline "../tools/xpl/typed-pipeline-library.xpl"
}

task rnc(dependsOn: ["library"], type: XMLCalabashTask) {
inputs.file "build/library.xml"
inputs.file "../tools/xpl/library-to-rnc.xpl"
inputs.file "../tools/xsl/library-to-rnc.xsl"
outputs.file "build/steps.rnc"
input("source", "build/library.xml")
output("result", "build/steps.rnc")
pipeline "../tools/xpl/library-to-rnc.xpl"
}

task rng(dependsOn: ["rnc"], type: JavaExec) {
inputs.file "build/steps.rnc"
outputs.file "build/steps.rng"
classpath = configurations.tools
main = 'com.thaiopensource.relaxng.translate.Driver'
args = ["build/steps.rnc", "build/steps.rng"]
}

task specification(dependsOn: [ "source", "library", "rng" ]) {
// nop
}

task clean() {
doFirst {
delete("build")
}
}
10 changes: 10 additions & 0 deletions step-rdf/build/glossary.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<appendix xmlns:db="http://docbook.org/ns/docbook" xmlns="http://docbook.org/ns/docbook" xml:id="glossary"><title>Glossary</title><glosslist><glossentry><glossterm>dynamic error</glossterm><glossdef><para>A <firstterm>dynamic error</firstterm> is one which occurs while a pipeline
is being evaluated.</para></glossdef></glossentry><glossentry><glossterm>implementation-defined</glossterm><glossdef><para>An
<firstterm>implementation-defined</firstterm> feature is one where the
implementation has discretion in how it is performed.
Conformant implementations <rfc2119>must</rfc2119> document
how <glossterm role="unwrapped">implementation-defined</glossterm> features are performed.</para></glossdef></glossentry><glossentry><glossterm>implementation-dependent</glossterm><glossdef><para>An
<firstterm>implementation-dependent</firstterm> feature is one where the
implementation has discretion in how it is performed.
Implementations are not required to document or explain
how <glossterm role="unwrapped">implementation-dependent</glossterm> features are performed.</para></glossdef></glossentry></glosslist></appendix>
15 changes: 15 additions & 0 deletions step-rdf/build/library.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<p:library xmlns:p="http://www.w3.org/ns/xproc"
xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax"
version="3.0">
<p:declare-step type="p:something-rdf" xml:id="something-rdf">
<p:input port="source"
primary="true"
sequence="false"
content-types="text/*"/>
<p:output port="result"
primary="true"
sequence="false"
content-types="application/xhtml+xml"/>
<p:option name="parameters" as="xs:string"/>
</p:declare-step>
</p:library>
179 changes: 179 additions & 0 deletions step-rdf/build/source.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
<specification xmlns:cs="http://www.w3.org/XML/XProc/2006/04/components#" xmlns:e="http://www.w3.org/1999/XSL/Spec/ElementSyntax" xmlns:p="http://www.w3.org/ns/xproc" xmlns:xi="http://www.w3.org/2001/XInclude" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://docbook.org/ns/docbook" xml:id="step-text" class="ed" role="step" version="5.0-extension w3c-xproc">
<info>
<title>XProc 3.0: RDF steps</title>
<!-- defaults to date formatted <pubdate>2014-12-18</pubdate> -->
<copyright>
<year>2019</year>
<holder>@@FIXME:</holder>
</copyright>

<bibliorelation type="isformatof" xlink:href="specification.xml">XML</bibliorelation>
<authorgroup>
<author>
<personname>Norman Walsh</personname>
</author>
<author>
<personname>Achim Berndzen</personname>
</author>
<author>
<personname>Gerrit Imsieke</personname>
</author>
<author>
<personname>Erik Siegel</personname>
</author>
</authorgroup>

<abstract>
<para>This specification describes the optional text related steps for <citetitle>XProc 3.0: An XML Pipeline Language</citetitle>.</para>
</abstract>

<legalnotice role="status">

<para><emphasis>This section describes the status of this document at the time of its publication. Other documents
may supersede this document.</emphasis></para>

<para>This document is derived from <link xlink:href="https://www.w3.org/TR/2010/REC-xproc-20100511/">XProc: An
XML Pipeline Language</link> published by the W3C.</para>
</legalnotice>
</info>

<section xml:id="introduction">
<title>Introduction</title>

<para>This specification describes the optional text related XProc steps. A machine-readable description of these steps may be found in <link xlink:href="steps.xpl">steps.xpl</link>. </para>

<para>Familarity with the general nature of <biblioref linkend="xproc30"/> steps is assumed; for background details,
see <biblioref linkend="xproc30-steps"/>.</para>
</section>

<section xml:id="c.something-rdf">
<title>p:something-rdf</title>

<para>The <code>p:something-rdf</code> step is just a placeholder.
The build for steps fails unless at least one step is defined.</para>

<p:declare-step type="p:something-rdf">
<p:input port="source" primary="true" sequence="false" content-types="text/*"/>
<p:output port="result" primary="true" sequence="false" content-types="application/xhtml+xml"/>
<p:option name="parameters" as="map(xs:QName, item()*)?"/>
</p:declare-step>

<para>TBD</para>

<simplesect>
<title>Document properties</title>
<para feature="load-preserves-none">No document properties are preserved.</para>
</simplesect>
</section>


<section xml:id="errors">
<title>Step Errors</title>

<para>These steps can raise <glossterm baseform="dynamic-error">dynamic errors</glossterm>. </para>

<para><termdef xml:id="dt-dynamic-error">A <firstterm>dynamic error</firstterm> is one which occurs while a pipeline
is being evaluated.</termdef> Examples of dynamic errors include references to URIs that cannot be resolved,
steps which fail, and pipelines that exhaust the capacity of an implementation (such as memory or disk space). For
a more complete discussion of dynamic errors, see <xspecref spec="xproc" xref="dynamic-errors"/>. </para>

<para>If a step fails due to a dynamic error, failure propagates upwards until either a <tag>p:try</tag> is
encountered or the entire pipeline fails. In other words, outside of a <tag>p:try</tag>, step failure causes the
entire pipeline to fail.</para>

<para>The following errors can be raised by this step:</para>

<?step-error-list level="none"?>

</section>

<appendix xml:id="conformance">
<title>Conformance</title>

<para>Conformant processors <rfc2119>must</rfc2119> implement all of the features
described in this specification except those that are explicitly identified
as optional.</para>

<para>Some aspects of processor behavior are not completely specified; those
features are either <glossterm role="unwrapped">implementation-dependent</glossterm> or
<glossterm role="unwrapped">implementation-defined</glossterm>.</para>

<para><termdef xml:id="dt-implementation-dependent">An
<firstterm>implementation-dependent</firstterm> feature is one where the
implementation has discretion in how it is performed.
Implementations are not required to document or explain
how <glossterm role="unwrapped">implementation-dependent</glossterm> features are performed.</termdef>
</para>

<para><termdef xml:id="dt-implementation-defined">An
<firstterm>implementation-defined</firstterm> feature is one where the
implementation has discretion in how it is performed.
Conformant implementations <rfc2119>must</rfc2119> document
how <glossterm role="unwrapped">implementation-defined</glossterm> features are performed.</termdef>
</para>

<section xml:id="implementation-defined">
<title>Implementation-defined features</title>

<para>The following features are implementation-defined:</para>

<?implementation-defined-features?>
</section>

<section xml:id="implementation-dependent">
<title>Implementation-dependent features</title>

<para>The following features are implementation-dependent:</para>

<?implementation-dependent-features?>
</section>
</appendix>

<appendix xml:id="references">
<title>References</title>
<bibliolist>
<bibliomixed xml:id="xproc30"><abbrev>XProc 3.0</abbrev>
<citetitle xlink:href="http://spec.xproc.org/">XProc 3.0:
An XML Pipeline Language</citetitle>.
Norman Walsh, Achim Berndzen, Gerrit Imsieke and Erik Siegel, editors.
</bibliomixed>
<bibliomixed xml:id="xproc30-steps"><abbrev>XProc 3.0 Steps</abbrev>
<citetitle xlink:href="http://spec.xproc.org/">XProc 3.0 Steps:
An Introduction</citetitle>.
Norman Walsh, Achim Berndzen, Gerrit Imsieke and Erik Siegel, editors.
</bibliomixed>
</bibliolist>
</appendix>

<!-- This glossary will automatically be elided if there are no
terms marked up as 'firstterm's in this specification. -->
<appendix xmlns:db="http://docbook.org/ns/docbook" xml:id="glossary"><title>Glossary</title><glosslist><glossentry><glossterm>dynamic error</glossterm><glossdef><para>A <firstterm>dynamic error</firstterm> is one which occurs while a pipeline
is being evaluated.</para></glossdef></glossentry><glossentry><glossterm>implementation-defined</glossterm><glossdef><para>An
<firstterm>implementation-defined</firstterm> feature is one where the
implementation has discretion in how it is performed.
Conformant implementations <rfc2119>must</rfc2119> document
how <glossterm role="unwrapped">implementation-defined</glossterm> features are performed.</para></glossdef></glossentry><glossentry><glossterm>implementation-dependent</glossterm><glossdef><para>An
<firstterm>implementation-dependent</firstterm> feature is one where the
implementation has discretion in how it is performed.
Implementations are not required to document or explain
how <glossterm role="unwrapped">implementation-dependent</glossterm> features are performed.</para></glossdef></glossentry></glosslist></appendix>

<appendix version="5.0-extension w3c-xproc" xml:id="ancillary-files">
<title>Ancillary files</title>

<para>This specification includes by reference a number of
ancillary files.</para>

<variablelist>
<varlistentry>
<term><link xlink:href="steps.xpl"/></term>
<listitem>
<para>An XProc step library for the declared steps.
</para>
</listitem>
</varlistentry>
</variablelist>

</appendix>

</specification>
17 changes: 17 additions & 0 deletions step-rdf/build/steps.rnc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
default namespace p = "http://www.w3.org/ns/xproc"
namespace local = ""

# This schema could be made more constrained.

Step = Step-something-rdf

Step-something-rdf =
element something-rdf {
name.ncname.attr?,
common.attributes,
use-when.attr?,
step.attributes,
attribute parameters { xsd:string }?,
(WithInput* & WithOption* & (Documentation|PipeInfo)*)
}

Loading