Skip to content

Commit d94f51f

Browse files
authored
docs: add mkdocs (#153)
1 parent 309f9d1 commit d94f51f

File tree

15 files changed

+605
-794
lines changed

15 files changed

+605
-794
lines changed

.github/workflows/gh-pages.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: pages
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
pages:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.12"
17+
- run: pip install mkdocs mkdocs-material
18+
- run: mkdocs gh-deploy --force

README.md

Lines changed: 11 additions & 212 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,15 @@
1-
rdflint
2-
---
1+
# rdflint
32

3+
[![Setup rdflint](https://img.shields.io/badge/Docs-mkdocs-light_green)](https://imas.github.io/rdflint/)
44
[![JitPack](https://jitpack.io/v/imas/rdflint.svg)](https://jitpack.io/#imas/rdflint)
5-
[![Marketplace Version](https://vsmarketplacebadge.apphb.com/version/takemikami.vscode-rdflint.svg "Current Release")](https://marketplace.visualstudio.com/items?itemName=takemikami.vscode-rdflint)
65
[![Setup rdflint](https://img.shields.io/badge/GitHub_Marketplace-Setup_rdflint-light_green)](https://github.com/marketplace/actions/setup-rdflint)
76
[![ci](https://github.com/imas/rdflint/actions/workflows/ci.yaml/badge.svg)](https://github.com/imas/rdflint/actions/workflows/ci.yaml)
87

9-
[rdflint Users Guide](https://imas.github.io/rdflint/)
10-
Note. Currencty translate to English from Japanese. Some part is still in Japanese.
11-
128
## What's rdflint
139

14-
rdflint is a linter for RDF files. Easy to check syntax and other things. rdflint is powered by [Apache Jena](https://jena.apache.org/).
10+
`rdflint` is a linter for RDF files. Easy to check syntax and other things. It helps your data making proces.
1511

16-
rdflint has following functions.
12+
`rdflint` has the following features of validation.
1713

1814
- Syntax check of rdf and Turtle(ttl).
1915
- Undefined subject check when use as predicate or object.
@@ -23,217 +19,20 @@ rdflint has following functions.
2319
- SHACL constraint validation.
2420
- Literal trim validation.
2521
- File encoding validation.
26-
- RDF generation by SPARQL query results.
27-
- SPARQL playground on your PC. (Interactive Mode)
28-
29-
## Getting Started
30-
31-
### Work on Visual Studio Code
32-
33-
Use [vscode-rdflint](vscode-rdflint/README.md)
34-
35-
### Work on your PC
36-
37-
Download from jitpack.
38-
39-
```
40-
$ wget https://jitpack.io/com/github/imas/rdflint/0.2.1/rdflint-0.2.1.jar
41-
```
42-
43-
Run for apply to your RDF files.
44-
45-
```
46-
$ java -jar rdflint-0.2.1.jar -targetdir example/dataset
47-
```
48-
49-
``-targetdir`` parameter is location of target RDF files.
50-
51-
### Work on GitHub Actions
52-
53-
Make ``.github/workflows/ci.yml`` to your repository. Its contents is following.
54-
55-
```
56-
name: CI
57-
on: pull_request
58-
jobs:
59-
rdflint:
60-
runs-on: ubuntu-latest
61-
steps:
62-
- uses: actions/checkout@v2
63-
- uses: actions/setup-java@v2
64-
with:
65-
distribution: adopt
66-
java-version: 11
67-
- uses: imas/setup-rdflint@v1
68-
- name: Run rdflint
69-
run: rdflint
70-
```
71-
72-
See [imas/setup-rdflint](https://github.com/imas/setup-rdflint) for more information.
73-
74-
## Configurations
75-
76-
When create a configuration file of rdflint, rdflint provide additional checks. Run with ``-config`` parameter like following.
77-
78-
```
79-
$ java -jar rdflint-0.2.1.jar -targetdir example/dataset -config example/dataset/rdflint-config.yml
80-
```
81-
82-
``-config`` parameter is location of rdflint configuration file.
83-
84-
### Undefined subject checks
85-
86-
Write configuration file like a following.
87-
88-
```
89-
baseUri: https://sparql.crssnky.xyz/imasrdf/
90-
```
91-
92-
And check undefined subject under baseUri, when use as predicate or object.
93-
94-
95-
### SPARQL based custom checks
96-
97-
Write configuration file like a following.
9822

99-
```
100-
rules:
101-
- name: file class
102-
target: "RDFs/765AS.rdf"
103-
query: |
104-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
105-
SELECT ?s ?o
106-
WHERE {
107-
?s rdf:type ?o .
108-
FILTER NOT EXISTS {
109-
?s rdf:type <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#Idol>
110-
}
111-
}
112-
valid: |
113-
while(rs.hasNext()) {
114-
log.warn("Idol definition file " + rs.next())
115-
}
116-
```
23+
And also has the following features of non-validation.
11724

118-
And run SPARQL query of ``rules-query`` to target file of ``rules-target``. Groovy script of ``rules-valid`` apply to result set of query.
119-
120-
### Degrade validation
121-
122-
Run with ``-origindir`` parameter like following.
123-
124-
```
125-
$ java -jar rdflint-0.2.1.jar -targetdir example/dataset -origindir example/dataset_origin -config example/dataset/rdflint-config.yml
126-
```
127-
128-
And check subject and triple, removed from origindir. Its problem report as INFO level.
129-
130-
131-
### SHACL constraint validation
132-
133-
write your SHACL constraint in `.ttl` or `.rdf` file.
134-
and put this file in directory which specified by `-targetdir`.
135-
136-
137-
### RDF generation
138-
139-
Write configuration file like a following.
140-
141-
```
142-
baseUri: https://sparql.crssnky.xyz/imasrdf/
143-
generation:
144-
- query: |
145-
PREFIX schema: <http://schema.org/>
146-
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
147-
PREFIX imas: <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#>
148-
SELECT ?m (group_concat(?s;separator=",,,,,")as ?u)
149-
WHERE {
150-
?s rdf:type imas:Unit;
151-
schema:member ?m.
152-
}group by (?m) order by (?m)
153-
template: .circleci/Unit_memberOf.rdf.template
154-
output: RDFs/Unit_memberOf.rdf
155-
```
156-
157-
Write template file like a following.
158-
159-
```
160-
<rdf:RDF
161-
xmlns:schema="http://schema.org/"
162-
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
163-
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
164-
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
165-
xmlns:imas="https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#"
166-
>[# th:each="idol : ${rs}"]
167-
<rdf:Description rdf:about="[(${idol.m.substring(params.baseUri.length()+5)})]">[# th:each="item : ${idol.u.split(',,,,,')}"]
168-
<schema:memberOf rdf:resource="[(${item})]"/>
169-
[/] </rdf:Description>
170-
[/]</rdf:RDF>
171-
```
172-
173-
And generate rdf file like a following.
174-
175-
```
176-
<rdf:RDF
177-
xmlns:schema="http://schema.org/"
178-
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
179-
xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
180-
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
181-
xmlns:imas="https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#"
182-
>
183-
<rdf:Description rdf:about="detail/Abe_Nana">
184-
<schema:memberOf rdf:resource="https://sparql.crssnky.xyz/imasrdf/RDFs/detail/%E8%99%B9%E8%89%B2%E3%83%89%E3%83%AA%E3%83%BC%E3%83%9E%E3%83%BC"/>
185-
<schema:memberOf rdf:resource="https://sparql.crssnky.xyz/imasrdf/RDFs/detail/%E3%82%AF%E3%83%AC%E3%82%A4%E3%83%B3%EF%BC%86%E3%83%90%E3%83%8B%E3%83%BC"/>
186-
....
187-
```
188-
189-
## Interactive Mode
190-
191-
Run interactive mode with ``-i`` parameter.
192-
193-
```
194-
$ java -jar rdflint-0.2.1.jar -i -targetdir example/dataset -config example/dataset/rdflint-config.yml
195-
```
25+
- RDF generation by SPARQL query results.
26+
- SPARQL playground on your PC. (Interactive Mode)
19627

197-
And try to query. Double return to perform query, type ``:exit`` to exit interactive mode.
28+
## Documentation
19829

199-
```
200-
sparql > PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
201-
> SELECT ?s
202-
> WHERE {
203-
> ?s rdf:type <https://sparql.crssnky.xyz/imasrdf/URIs/imas-schema.ttl#Idol> .
204-
> }
205-
>
206-
---------------------------------------------------------------------
207-
| s |
208-
=====================================================================
209-
| <https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Hagiwara_Yukiho> |
210-
| <https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Miura_Azusa> |
211-
| <https://sparql.crssnky.xyz/imasrdf/RDFs/detail/Takatsuki_Yayoi> |
212-
........
213-
```
30+
You can find information of `rdflint` in [documentation website](https://imas.github.io/rdflint/).
21431

21532
## Contributing
21633

217-
Please fork this repository, and create pull request for contributing.
218-
219-
### Build and execute
220-
221-
Build rdflint with gradle.
222-
223-
```
224-
$ gradle shadowJar
225-
```
226-
227-
Run rdflint.
228-
229-
```
230-
$ java -jar build/libs/rdflint.jar -targetdir example/dataset
231-
```
232-
233-
### IDE Settings
234-
235-
Use [dotidea](https://github.com/imas/rdflint/tree/dotidea) - Project Settings for IntelliJ IDEA.
34+
If you would like to contribute to `rdflint`, you can find information about contributing in [Contributor's guide](https://imas.github.io/rdflint/contributing/).
23635

23736
## License
23837

239-
rdflint is released under the [MIT License](https://github.com/imas/rdflint/blob/master/LICENSE).
38+
`rdflint` is released under the [MIT License](https://github.com/imas/rdflint/blob/master/LICENSE).

0 commit comments

Comments
 (0)