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

feat: Support table headers in formatted text (DEV-3473) #3210

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
2 changes: 2 additions & 0 deletions docs/03-endpoints/api-v2/text/standard-standoff.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,10 @@ that are mapped to standoff classes and properties defined in the ontology:
- `<ul>` → `standoff:StandoffUnrderedListTag`
- `<li>` → `standoff:StandoffListElementTag`
- `<tbody>` → `standoff:StandoffTableBodyTag`
- `<thead>` → `standoff:StandoffTableHeaderTag`
- `<table>` → `standoff:StandoffTableTag`
- `<tr>` → `standoff:StandoffTableRowTag`
- `<th>` → `standoff:StandoffTableHeaderCellTag`
- `<td>` → `standoff:StandoffTableCellTag`
- `<br>` → `standoff:StandoffBrTag`
- `<hr>` → `standoff:StandoffLineTag`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2298,6 +2298,188 @@
"@type": "owl:Class",
"@id": "standoff:StandoffTableCellTag"
},
{
"knora-api:isStandoffClass": true,
"rdfs:subClassOf": [
{
"@id": "standoff:StandoffStructuralTag"
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEnd"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEndIndex"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEndParent"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEndParentIndex"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasOriginalXMLID"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStart"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStartIndex"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStartParent"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStartParentIndex"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasUUID"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
}
],
"rdfs:comment": "Represents a cell in a header row in a table",
"@type": "owl:Class",
"@id": "standoff:StandoffTableHeaderCellTag"
},
{
"knora-api:isStandoffClass": true,
"rdfs:subClassOf": [
{
"@id": "standoff:StandoffStructuralTag"
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEnd"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEndIndex"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEndParent"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasEndParentIndex"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasOriginalXMLID"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStart"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStartIndex"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStartParent"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasStartParentIndex"
},
"owl:maxCardinality": 1,
"knora-api:isInherited": true
},
{
"@type": "owl:Restriction",
"owl:onProperty": {
"@id": "knora-api:standoffTagHasUUID"
},
"owl:cardinality": 1,
"knora-api:isInherited": true
}
],
"rdfs:comment": "Represents a table header in a TextValue",
"@type": "owl:Class",
"@id": "standoff:StandoffTableHeaderTag"
},
{
"knora-api:isStandoffClass": true,
"rdfs:subClassOf": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
rdf:type owl:Ontology ;
rdfs:label "The Knora base ontology"@en ;
:attachedToProject knora-admin:SystemProject ;
:ontologyVersion "knora-base v36" .
:ontologyVersion "knora-base v37" .


#################################################################
Expand Down
18 changes: 18 additions & 0 deletions webapi/src/main/resources/knora-ontologies/standoff-data.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/uJ4GgFl_Qki-cYHae_nAtA>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/X-SQznMkTx-LZRLAY74ePA>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/62844c98-7251-11e7-8cf>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/2tO9l7IZSEKktbCPWc2Enw>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/_-8MPxJFSAiZm1T-g3Ymzg>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/vlGCAF3kQyywpobNu1T7ng>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/CFGtLwdXQyGdVpMyfB9Leg>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/ktOIwFHSTm-GC1RVF3HZpw>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/ZeSrjYCxT-anWm8YYy61Uw>,
<http://rdfh.ch/standoff/mappings/StandardMapping/elements/a05L2z3NT3iMWMn7nFqIOA>,
Expand Down Expand Up @@ -254,6 +256,14 @@
knora-base:mappingElementRequiresSeparator true ;
knora-base:mappingHasXMLTagname "tbody"^^xsd:string .

<http://rdfh.ch/standoff/mappings/StandardMapping/elements/2tO9l7IZSEKktbCPWc2Enw>
a knora-base:MappingElement ;
knora-base:mappingHasStandoffClass standoff:StandoffTableHeaderTag ;
knora-base:mappingHasXMLClass "noClass"^^xsd:string ;
knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ;
knora-base:mappingElementRequiresSeparator true ;
knora-base:mappingHasXMLTagname "thead"^^xsd:string .

<http://rdfh.ch/standoff/mappings/StandardMapping/elements/_-8MPxJFSAiZm1T-g3Ymzg>
a knora-base:MappingElement ;
knora-base:mappingHasStandoffClass standoff:StandoffTableRowTag ;
Expand All @@ -270,6 +280,14 @@
knora-base:mappingElementRequiresSeparator true ;
knora-base:mappingHasXMLTagname "td"^^xsd:string .

<http://rdfh.ch/standoff/mappings/StandardMapping/elements/CFGtLwdXQyGdVpMyfB9Leg>
a knora-base:MappingElement ;
knora-base:mappingHasStandoffClass standoff:StandoffTableHeaderCellTag ;
knora-base:mappingHasXMLClass "noClass"^^xsd:string ;
knora-base:mappingHasXMLNamespace "noNamespace"^^xsd:string ;
knora-base:mappingElementRequiresSeparator true ;
knora-base:mappingHasXMLTagname "th"^^xsd:string .

<http://rdfh.ch/standoff/mappings/StandardMapping/elements/ktOIwFHSTm-GC1RVF3HZpw>
a knora-base:MappingElement ;
knora-base:mappingHasStandoffClass standoff:StandoffBrTag ;
Expand Down
16 changes: 16 additions & 0 deletions webapi/src/main/resources/knora-ontologies/standoff-onto.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,14 @@
rdfs:comment "Represents a list element in a TextValue"@en .


### http://www.knora.org/ontology/standoff#StandoffTableBodyTag

:StandoffTableHeaderTag
rdf:type owl:Class ;
rdfs:subClassOf :StandoffStructuralTag ;
rdfs:comment "Represents a table header in a TextValue"@en .


### http://www.knora.org/ontology/standoff#StandoffTableBodyTag

:StandoffTableBodyTag
Expand Down Expand Up @@ -225,6 +233,14 @@
rdfs:comment "Represents a cell in a table"@en .


### http://www.knora.org/ontology/standoff#StandoffTableHeaderCellTag

:StandoffTableHeaderCellTag
rdf:type owl:Class ;
rdfs:subClassOf :StandoffStructuralTag ;
rdfs:comment "Represents a cell in a header row in a table"@en .


### http://www.knora.org/ontology/standoff#StandoffBrTag

:StandoffBrTag
Expand Down
2 changes: 1 addition & 1 deletion webapi/src/main/scala/org/knora/webapi/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ package object webapi {
* The version of `knora-base` and of the other built-in ontologies that this version of Knora requires.
* Must be the same as the object of `knora-base:ontologyVersion` in the `knora-base` ontology being used.
*/
val KnoraBaseVersion: String = "knora-base v36"
val KnoraBaseVersion: String = "knora-base v37"

/**
* `IRI` is a synonym for `String`, used to improve code readability.
Expand Down
Loading