Skip to content
Open
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
63f849d
Fix DifferentIndividuals translation
ckindermann Sep 2, 2025
07c7449
DisjointUnionOf -> DisjointUnion
ckindermann Sep 2, 2025
3ae66a9
Expand IRIs in ofn_2_rdfa
ckindermann Sep 2, 2025
e19442f
Expand Iris in ofn_2_thick
ckindermann Sep 2, 2025
fe4b756
Expand IRis in labelling
ckindermann Sep 2, 2025
80cb20c
Expand IRIs in ofn_typing
ckindermann Sep 2, 2025
8e8e890
Expand IRIs in parser
ckindermann Sep 2, 2025
415e219
Expand IRis in thick_2_ofn
ckindermann Sep 2, 2025
d700247
Expand IRis in OWL datamodel
ckindermann Sep 2, 2025
2ffca29
Fix NegativePropertyAssertions
ckindermann Sep 15, 2025
4dc9298
Fix datatype translation
ckindermann Sep 30, 2025
06928b5
Handle full-iri datatypes
ckindermann Sep 30, 2025
e0ab504
Remove 'plain' literals
ckindermann Sep 30, 2025
b23175a
Fix data property assertion
ckindermann Sep 30, 2025
76d7190
Fix panic on empty array
ckindermann Oct 14, 2025
f03e524
Fix translation of HasKey axioms
ckindermann Oct 14, 2025
afa8fa3
Fix datatype
ckindermann Oct 21, 2025
f86b3c5
Update artifact build
ckindermann Dec 2, 2025
8c5d5c9
Add ClassAtom translation
ckindermann Feb 13, 2026
0f79761
Introduce constants for OWL vocabulary
ckindermann Feb 13, 2026
46e8720
Add function for splitting logic and annotations
ckindermann Feb 17, 2026
bcd596a
Refactor blank node generation
ckindermann Feb 17, 2026
909d2e6
Compile regexes once
ckindermann Feb 17, 2026
b5c3be4
Introduce constant for owl:Axiom
ckindermann Apr 8, 2026
3591e32
Replace xsd:string
ckindermann Apr 8, 2026
bca7191
Add constants for LDTab datatypes
ckindermann Apr 8, 2026
08a4f44
Move constants to top level
ckindermann Apr 8, 2026
4715c23
Use constants
ckindermann Apr 9, 2026
c3f6a69
Remove warnings
ckindermann Apr 9, 2026
2922db4
Expand IRIs in tests
ckindermann Apr 9, 2026
622f0d5
Expand IRIs in docstring tests
ckindermann Apr 9, 2026
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
71 changes: 19 additions & 52 deletions .github/workflows/Build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,40 @@ jobs:
build-binaries:
strategy:
matrix:
target: [
{ runner: "macos-11", arch: "x86_64-apple-darwin" },
{ runner: "macos-11", arch: "aarch64-apple-darwin" },
{ runner: "windows-2022", arch: "x86_64-pc-windows-msvc" },
{ runner: "ubuntu-20.04", arch: "x86_64-unknown-linux-gnu" },
{ runner: "ubuntu-20.04", arch: "x86_64-unknown-linux-musl" },
]
target:
- { runner: "macos-latest", arch: "x86_64-apple-darwin" }
- { runner: "macos-latest", arch: "aarch64-apple-darwin" }
- { runner: "windows-2022", arch: "x86_64-pc-windows-msvc" }
- { runner: "ubuntu-latest", arch: "x86_64-unknown-linux-gnu" }
- { runner: "ubuntu-latest", arch: "x86_64-unknown-linux-musl" }

runs-on: ${{ matrix.target.runner }}

steps:
- name: Check out repository code
uses: actions/checkout@v3
uses: actions/checkout@v6

- name: Install musl-tools (MUSL)
if: ${{ matrix.target.runner == 'ubuntu-20.04' && matrix.target.arch == 'x86_64-unknown-linux-musl' }}
if: ${{ startsWith(matrix.target.runner, 'ubuntu') && matrix.target.arch == 'x86_64-unknown-linux-musl' }}
run: |
sudo apt-get update
sudo apt-get install musl-tools
sudo apt-get install -y musl-tools

- name: Install latest rust toolchain
uses: actions-rs/toolchain@v1
- name: Install latest Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.target.arch }}
default: true
override: true
targets: ${{ matrix.target.arch }}

- name: Build binary using cross (Linux)
if: ${{ matrix.target.runner == 'ubuntu-20.04' }}
if: ${{ startsWith(matrix.target.runner, 'ubuntu') }}
run: |
cargo install cross --git https://github.com/cross-rs/cross
sudo systemctl start docker
sudo systemctl start docker || true
cross build --release --target ${{ matrix.target.arch }}
cp target/${{ matrix.target.arch }}/release/wiring_rs wiring-${{ matrix.target.arch }}

- name: Build binary using cargo (MacOS)
if: ${{ matrix.target.runner == 'macos-11' }}
- name: Build binary using cargo (macOS)
if: ${{ startsWith(matrix.target.runner, 'macos') }}
run: |
cargo build --release --target ${{ matrix.target.arch }}
cp target/${{ matrix.target.arch }}/release/wiring_rs wiring-${{ matrix.target.arch }}
Expand All @@ -57,41 +55,10 @@ jobs:
run: |
cargo build --release --target ${{ matrix.target.arch }}
cp target\${{ matrix.target.arch }}\release\wiring_rs.exe wiring-${{ matrix.target.arch }}
#cp target\${{ matrix.target.arch }}\release\wiring.exe wiring-${{ matrix.target.arch }}.exe

- name: Upload binary artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target.arch }}-bin
path: wiring-${{ matrix.target.arch }}
#path: man-parse-rust/target/${{ matrix.platform.target }}/release/man-parse-rust
if-no-files-found: error

# - name: Upload binary to release
# uses: svenstaro/upload-release-action@v2
# with:
# file: ontodev_valve-${{ matrix.target.arch }}*
# file_glob: true
# tag: ${{ github.ref }}
# overwrite: true
#
# cargo-publish:
# needs: build-binaries
# runs-on: ubuntu-20.04
# steps:
# - name: Check out repository code
# uses: actions/checkout@v3
#
# - name: Install latest rust toolchain
# uses: actions-rs/toolchain@v1
# with:
# toolchain: stable
# target: ${{ matrix.target.arch }}
# default: true
# override: true
#
# - name: Publish to crates.io
# env:
# CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
# run: |
# cargo publish
4 changes: 2 additions & 2 deletions src/ldtab_2_ofn/axiom_translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ pub fn translate_disjoint_with(subject: &owl::OWL, object: &owl::OWL) -> Value {
///
/// let axiom : Value = translation::translate_disjoint_union(&union_owl,
/// &operands_owl);
/// let axiom_expected_string = r#"["DisjointUnionOf","obo:IAO_0000120","obo:IAO_0000121","obo:IAO_0000122"]"#;
/// let axiom_expected_string = r#"["DisjointUnion","obo:IAO_0000120","obo:IAO_0000121","obo:IAO_0000122"]"#;
/// let axiom_expected : Value = serde_json::from_str(axiom_expected_string).unwrap();
///
/// assert_eq!(axiom, axiom_expected);
Expand All @@ -362,7 +362,7 @@ pub fn translate_disjoint_union(union: &owl::OWL, operands: &owl::OWL) -> Value
let lhs = class_translation::translate(union);
let rhs = class_translation::translate(operands);

let operator = Value::String("DisjointUnionOf".into());
let operator = Value::String("DisjointUnion".into());

match rhs {
Value::Array(mut arr) => {
Expand Down
60 changes: 31 additions & 29 deletions src/ofn_2_ldtab/annotation_translation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,34 @@ use regex::Regex;
use serde_json::json;
use serde_json::Value;
use std::collections::HashMap;
use std::sync::LazyLock;

static RE_SIMPLE_STRING: LazyLock<Regex> =
LazyLock::new(|| Regex::new("^\"(?s)(.*)\"$").unwrap());
static RE_LANG_TAG: LazyLock<Regex> =
LazyLock::new(|| Regex::new("^\"(?s)(.*)\"@(.*)$").unwrap());
static RE_TYPED_LITERAL: LazyLock<Regex> =
LazyLock::new(|| Regex::new("^\"(?s)(.*)\"\\^\\^(.*)$").unwrap());
static RE_LITERAL: LazyLock<Regex> =
LazyLock::new(|| Regex::new("^\"(?s)(.+)\"(.*)$").unwrap());
static RE_URI: LazyLock<Regex> =
LazyLock::new(|| Regex::new("^<(.+)>$").unwrap());
static RE_CURIE: LazyLock<Regex> =
LazyLock::new(|| Regex::new("^(.+):(.+)$").unwrap());

pub fn is_annotation(v: &Value) -> bool {
match v.clone() {
Value::Array(x) => {
match x[0].as_str() {
Some("Annotation") => true,
//Some("AnnotationList") => true, //NB: this shouldn't occur
Some(_) => false,
None => false,
}
}
_ => false,
}
matches!(
v,
Value::Array(xs)
if xs.get(0)
.and_then(Value::as_str)
== Some("Annotation")
)
}




pub fn has_annotation(v: &Value) -> bool {
match v.clone() {
Value::Array(x) => is_annotation(&x[1]), //look into second argument
Expand Down Expand Up @@ -57,17 +70,10 @@ pub fn get_annotations(v: &Value) -> Vec<Value> {
pub fn is_literal(value: &Value) -> bool {
// Ensure the Value is a string
if let Some(s) = value.as_str() {
// Regex for a simple quoted string
let simple_string_re = Regex::new("^\"(?s)(.*)\"$").unwrap();
// Regex for a string with a language tag (e.g., "hello"@en)
let lang_tag_re = Regex::new("^\"(?s)(.*)\"@(.*)$").unwrap();
// Regex for a string with a datatype IRI or CURIE (e.g., "42"^^<http://example.com> or "42"^^prefix:suffix)
let iri_or_curie_re = Regex::new("^\"(?s)(.*)\"\\^\\^(.*)$").unwrap();

// Check if the string matches any of the forms
return simple_string_re.is_match(s)
|| lang_tag_re.is_match(s)
|| iri_or_curie_re.is_match(s);
// Check if the string matches any of the literal forms
return RE_SIMPLE_STRING.is_match(s)
|| RE_LANG_TAG.is_match(s)
|| RE_TYPED_LITERAL.is_match(s);
}
false
}
Expand Down Expand Up @@ -121,17 +127,13 @@ pub fn translate_literal(s: &str) -> Value {
pub fn translate_value(v: &Value) -> Value {
let s = v.as_str().unwrap();

let literal = Regex::new("^\"(?s)(.+)\"(.*)$").unwrap();
let uri = Regex::new("^<(.+)>$").unwrap();
let curie = Regex::new("^(.+):(.+)$").unwrap();

if literal.is_match(s) {
if RE_LITERAL.is_match(s) {
translate_literal(s)
} else if uri.is_match(s) {
} else if RE_URI.is_match(s) {
json!({"object" : s,
"meta" : "owl:Axiom",
"datatype" : "_IRI"})
} else if curie.is_match(s) {
} else if RE_CURIE.is_match(s) {
json!({"object" : s,
"meta" : "owl:Axiom",
"datatype" : "_IRI"})
Expand Down
Loading