Skip to content

Commit

Permalink
fix: Fix wrong Declaration typescript types
Browse files Browse the repository at this point in the history
  • Loading branch information
floers committed Nov 22, 2022
1 parent 195a8de commit 12e6c9a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions benches/benchmarks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ pub fn parser_bench(b: &mut Bencher, turtle: &str) {
Ontology::parse(
turtle,
ParserOptions::builder()
.known(owlish::owl::Declaration::AnnotationProperty(
IRI::new("http://query-server.field33.com/ontology/query-field")
.known(owlish::owl::Declaration::AnnotationProperty {
iri: IRI::new("http://query-server.field33.com/ontology/query-field")
.unwrap()
.into(),
vec![],
))
annotations: vec![],
})
.build(),
)
.unwrap();
Expand Down
6 changes: 3 additions & 3 deletions extend_wasm_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,10 @@ export function matchAxiom(axiom, matcher) {
}
}
export function matchDeclaration(axiom, matcher) {
for (const key in axiom) {
export function matchDeclaration(declaration, matcher) {
for (const key in declaration) {
if (matcher[key]) {
matcher[key](axiom[key])
matcher[key](declaration[key])
break
}
}
Expand Down
24 changes: 12 additions & 12 deletions src/api/wasm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,12 +112,12 @@ extern "C" {
#[wasm_bindgen(typescript_custom_section)]
const ONTOLOGY_TS_API: &'static str = r#"
interface Declaration {
Class?: [IRI, Array<Annotation>],
NamedIndividual?: [IRI, Array<Annotation>],
ObjectProperty?: [IRI, Array<Annotation>],
DataProperty?: [IRI, Array<Annotation>],
AnnotationProperty?: [IRI, Array<Annotation>],
Datatype?: [IRI, Array<Annotation>],
Class?: {iri: IRI, annotations: Array<Annotation>},
NamedIndividual?: {iri: IRI, annotations: Array<Annotation>},
ObjectProperty?: {iri: IRI, annotations: Array<Annotation>},
DataProperty?: {iri: IRI, annotations: Array<Annotation>},
AnnotationProperty?: {iri: IRI, annotations: Array<Annotation>},
Datatype?: {iri: IRI, annotations: Array<Annotation>},
}
interface Axiom {
Expand Down Expand Up @@ -189,12 +189,12 @@ export interface AxiomMatcher<R> {
export function matchAxiom<R>(axiom: Axiom, matcher: AxiomMatcher<R>): R
interface DeclarationMatcher<R> {
Class?: (cls: [IRI, Array<Annotation>]) => R,
NamedIndividual?: (individual: [IRI, Array<Annotation>]) => R,
ObjectProperty?: (objectProp: [IRI, Array<Annotation>]) => R,
DataProperty?: (dataProp: [IRI, Array<Annotation>]) => R,
AnnotationProperty?: (annotationProp: [IRI, Array<Annotation>]) => R,
Datatype?: (datatype: [IRI, Array<Annotation>]) => R,
Class?: (cls: Declaration["Class"]) => R,
NamedIndividual?: (individual: Declaration["NamedIndividual"]) => R,
ObjectProperty?: (objectProp: Declaration["ObjectProperty"]) => R,
DataProperty?: (dataProp: Declaration["DataProperty"]) => R,
AnnotationProperty?: (annotationProp: Declaration["AnnotationProperty"]) => R,
Datatype?: (datatype: Declaration["Datatype"]) => R,
}
Expand Down

0 comments on commit 12e6c9a

Please sign in to comment.