|
| 1 | +# generated by datamodel-codegen: |
| 2 | +# filename: https://raw.githubusercontent.com/propi/rdfrules/master/http/schema.json |
| 3 | +# timestamp: 2024-09-11T13:34:02+00:00 |
| 4 | + |
| 5 | +from __future__ import annotations |
| 6 | + |
| 7 | +from enum import Enum |
| 8 | +from typing import List, Literal, Optional, Union |
| 9 | + |
| 10 | +from pydantic import AnyUrl, BaseModel, ConfigDict, Field, RootModel |
| 11 | + |
| 12 | + |
| 13 | +class BaseObject(BaseModel): |
| 14 | + pass |
| 15 | + |
| 16 | + |
| 17 | +class GraphPath(RootModel[str]): |
| 18 | + root: str = Field( |
| 19 | + ..., |
| 20 | + pattern='^.+[.](ttl|nt|nq|json|jsonld|xml|rdf|owl|trig|trix|tsv|sql|cache)([.](gz|bz2))?$', |
| 21 | + title='Choose a file from the workspace', |
| 22 | + ) |
| 23 | + """ |
| 24 | + Load a file from the workspace on the server side. The dataset format is detected automatically by the file extension. Supported extensions are .ttl (turtle), .nt (n-triples), .nq (n-quads), .json | .jsonld (JSON-LD), .xml | .rdf | .owl (RDF/XML), .trig (TriG), .trix (TriX), .tsv, .sql, .cache (internal binary format). All formats can be compressed by GZIP or BZ2 (e.g. data.ttl.gz). |
| 25 | + """ |
| 26 | + |
| 27 | + |
| 28 | +class GraphUrl(RootModel[AnyUrl]): |
| 29 | + root: AnyUrl = Field(..., title='URL') |
| 30 | + """ |
| 31 | + A URL to a remote file to be loaded. If this is specified then the workspace file is ommited. |
| 32 | + """ |
| 33 | + |
| 34 | + |
| 35 | +class GraphName(RootModel[str]): |
| 36 | + root: str = Field(..., pattern='^<.*>$', title='Graph name') |
| 37 | + """ |
| 38 | + Name for this loaded graph. It must have the URI notation in angle brackets, e.g., <dbpedia> or `<http://dbpedia.org>`. |
| 39 | + """ |
| 40 | + |
| 41 | + |
| 42 | +class SourceSettings(Enum): |
| 43 | + tsvRaw = 'tsvRaw' |
| 44 | + tsvParsedUris = 'tsvParsedUris' |
| 45 | + tsvParsedLiterals = 'tsvParsedLiterals' |
| 46 | + |
| 47 | + |
| 48 | +class QuadFilter(BaseModel): |
| 49 | + model_config = ConfigDict( |
| 50 | + extra='forbid', |
| 51 | + ) |
| 52 | + subject: Optional[str] = None |
| 53 | + predicate: Optional[str] = None |
| 54 | + object: Optional[str] = None |
| 55 | + graph: Optional[str] = None |
| 56 | + inverse: Optional[bool] = None |
| 57 | + |
| 58 | + |
| 59 | +class LoadGraph(BaseModel): |
| 60 | + name: Literal['LoadGraph'] = 'LoadGraph' |
| 61 | + parameters: Optional[BaseObject] = None |
| 62 | + |
| 63 | + |
| 64 | +class FilterQuads(BaseModel): |
| 65 | + name: Literal['FilterQuads'] = 'FilterQuads' |
| 66 | + parameters: Optional[BaseObject] = None |
| 67 | + |
| 68 | + |
| 69 | +class Model(RootModel[List[Union[LoadGraph, FilterQuads]]]): |
| 70 | + root: List[Union[LoadGraph, FilterQuads]] |
0 commit comments