From 052c4f3b440913a4b74d4f6f51cd81a09dfab483 Mon Sep 17 00:00:00 2001 From: sriramsowmithri9807 Date: Fri, 7 Feb 2025 06:15:40 +0530 Subject: [PATCH 1/6] `Removed AI project files and demo subprojects` --- sbol_utilities/conversion.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/sbol_utilities/conversion.py b/sbol_utilities/conversion.py index 225c55b7..5d6a983f 100644 --- a/sbol_utilities/conversion.py +++ b/sbol_utilities/conversion.py @@ -115,11 +115,12 @@ def convert2to3(sbol2_doc: Union[str, sbol2.Document], namespaces=None, use_nati # add in the missing namespace fields where possible, defaulting otherwise # TODO: add check for non-TopLevel? See https://github.com/SynBioDex/pySBOL3/issues/295 needs_namespace = {o for o in doc.objects if o.namespace is None} - for n in namespaces: - assignable = {o for o in needs_namespace if o.identity.startswith(n)} - for a in assignable: - a.namespace = n - needs_namespace = needs_namespace - assignable + for s, p, o in g.triples((None, rdflib.RDF.type, None)): + if o.startswith(sbol3.PROV_NS): + if str(o) in {sbol3.PROV_ASSOCIATION, sbol3.PROV_USAGE}: + g.add((s, p, rdflib.URIRef(sbol3.SBOL_IDENTIFIED))) + else: + g.add((s, p, rdflib.URIRef(sbol3.SBOL_TOP_LEVEL))) for o in needs_namespace: # if no supplied namespace matches, default to scheme//netloc # figure out the server to access from the URL p = urllib.parse.urlparse(o.identity) From 968c4aeb2767739bd8b61cd892bc12aeb104db39 Mon Sep 17 00:00:00 2001 From: sriramsowmithri9807 Date: Fri, 7 Feb 2025 06:21:29 +0530 Subject: [PATCH 2/6] `Removed AI project files and demo subprojects` --- sbol_utilities/conversion.py | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/sbol_utilities/conversion.py b/sbol_utilities/conversion.py index 5d6a983f..e74a43b3 100644 --- a/sbol_utilities/conversion.py +++ b/sbol_utilities/conversion.py @@ -114,13 +114,25 @@ def convert2to3(sbol2_doc: Union[str, sbol2.Document], namespaces=None, use_nati # TODO: remove workaround after conversion errors fixed in https://github.com/sboltools/sbolgraph/issues/14 # add in the missing namespace fields where possible, defaulting otherwise # TODO: add check for non-TopLevel? See https://github.com/SynBioDex/pySBOL3/issues/295 - needs_namespace = {o for o in doc.objects if o.namespace is None} - for s, p, o in g.triples((None, rdflib.RDF.type, None)): - if o.startswith(sbol3.PROV_NS): - if str(o) in {sbol3.PROV_ASSOCIATION, sbol3.PROV_USAGE}: - g.add((s, p, rdflib.URIRef(sbol3.SBOL_IDENTIFIED))) - else: - g.add((s, p, rdflib.URIRef(sbol3.SBOL_TOP_LEVEL))) + # Namespace Assignment +needs_namespace = {o for o in doc.objects if o.namespace is None} +for n in namespaces: + assignable = {o for o in needs_namespace if o.identity.startswith(n)} + for a in assignable: + a.namespace = n + needs_namespace = needs_namespace - assignable +for o in needs_namespace: + p = urllib.parse.urlparse(o.identity) + server = urllib.parse.urlunparse([p.scheme, p.netloc, '', '', '', '']) + o.namespace = server + +# Sequence Inference +for s in (o for o in doc.objects if isinstance(o, sbol3.Component)): + if len(s.sequences) != 1: + continue + for f in (f for f in s.features if isinstance(f, sbol3.SequenceFeature) or isinstance(f, sbol3.SubComponent)): + for loc in f.locations: + loc.sequence = s.sequences[0] for o in needs_namespace: # if no supplied namespace matches, default to scheme//netloc # figure out the server to access from the URL p = urllib.parse.urlparse(o.identity) From ccc3af6998d4d4d9032ae14f8248490b90c70d90 Mon Sep 17 00:00:00 2001 From: sowmithri sriram <95630559+sriramsowmithri9807@users.noreply.github.com> Date: Mon, 3 Mar 2025 22:49:37 +0530 Subject: [PATCH 3/6] Create npm-grunt.yml --- .github/workflows/npm-grunt.yml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 .github/workflows/npm-grunt.yml diff --git a/.github/workflows/npm-grunt.yml b/.github/workflows/npm-grunt.yml new file mode 100644 index 00000000..287f79f2 --- /dev/null +++ b/.github/workflows/npm-grunt.yml @@ -0,0 +1,28 @@ +name: NodeJS with Grunt + +on: + push: + branches: [ "develop" ] + pull_request: + branches: [ "develop" ] + +jobs: + build: + runs-on: ubuntu-latest + + strategy: + matrix: + node-version: [18.x, 20.x, 22.x] + + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v4 + with: + node-version: ${{ matrix.node-version }} + + - name: Build + run: | + npm install + grunt From 6f1f4beeaa54d4cf00793c513ad906bf8fff38c2 Mon Sep 17 00:00:00 2001 From: sowmithri sriram <95630559+sriramsowmithri9807@users.noreply.github.com> Date: Mon, 3 Mar 2025 22:49:56 +0530 Subject: [PATCH 4/6] Create npm-publish.yml --- .github/workflows/npm-publish.yml | 33 +++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 .github/workflows/npm-publish.yml diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 00000000..2a4766d3 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -0,0 +1,33 @@ +# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created +# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages + +name: Node.js Package + +on: + release: + types: [created] + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + - run: npm ci + - run: npm test + + publish-npm: + needs: build + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org/ + - run: npm ci + - run: npm publish + env: + NODE_AUTH_TOKEN: ${{secrets.npm_token}} From 8b0db6a735fb30fee80e796fd94e072fbdbc77bf Mon Sep 17 00:00:00 2001 From: sowmithri sriram <95630559+sriramsowmithri9807@users.noreply.github.com> Date: Thu, 13 Mar 2025 22:52:16 +0530 Subject: [PATCH 5/6] Update README.md From d26af0dbcb84a1b86028e0d353d6ed1ab5ca5456 Mon Sep 17 00:00:00 2001 From: sowmithri sriram <95630559+sriramsowmithri9807@users.noreply.github.com> Date: Thu, 13 Mar 2025 22:52:51 +0530 Subject: [PATCH 6/6] Update README.md