Skip to content

Commit

Permalink
Update prototype: more branching
Browse files Browse the repository at this point in the history
  • Loading branch information
omaus committed Nov 22, 2023
1 parent 1581357 commit 4dbcf11
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions playgrounds/arcGraph_playgrounds/prototype_v0.2.1.fsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#I "../ARCTokenization/src/ARCTokenization/bin/Debug/netstandard2.0"
#I "../ARCTokenization/src/ARCTokenization/bin/Release/netstandard2.0"
#I "../../../ARCTokenization/src/ARCTokenization/bin/Debug/netstandard2.0"
#I "../../../ARCTokenization/src/ARCTokenization/bin/Release/netstandard2.0"
#r "ARCTokenization.dll"
#r "ControlledVocabulary.dll"
#I "src/ARCExpect/bin/Debug/netstandard2.0"
#I "src/ARCExpect/bin/Release/netstandard2.0"
#I "../../src/ARCExpect/bin/Debug/netstandard2.0"
#I "../../src/ARCExpect/bin/Release/netstandard2.0"
#r "ARCExpect.dll"

//#r "nuget: ARCTokenization"
Expand Down Expand Up @@ -320,18 +320,22 @@ let deconstructTf tf =
| MisplacedTerm ip -> ip
| ObsoleteTerm ip -> ip

let constructSubgraph (ontoGraph : FGraph<string,OboTerm,ARCRelation>) (ips : (string * TermFamiliarity seq) seq) =
let constructGraph (ontoGraph : FGraph<string,OboTerm,ARCRelation>) (ips : (string * TermFamiliarity seq) seq) =
let rec loop (section : (string * TermFamiliarity seq) list) (stash : (string * TermFamiliarity seq) list) (header : IParam) (priorParams : string * IParam seq) (graph : FGraph<string,IParam seq,ARCRelation>) =
match section with
| (hn,hts) :: t ->
match Seq.head hts with
| UnknownTerm ip ->
FGraph.addElement hn (hts |> Seq.map deconstructTf) (fst priorParams) (snd priorParams) ARCRelation.Unknown graph
|> loop t stash header priorParams
| MisplacedTerm ip ->
let priorName,priorIps = priorParams
if hasPartOfTo ontoGraph ip header then
let hips = hts |> Seq.map deconstructTf
| KnownTerm ip ->
let priorName,priorIps = priorParams
if hasFollowsTo ontoGraph ip (Seq.head priorIps) then
let hips = (hts |> Seq.map deconstructTf)
let hips = hts |> Seq.map deconstructTf
FGraph.addElement hn hips priorName priorIps ARCRelation.Follows graph
|> loop t stash header (hn, hips)
else
Expand Down

0 comments on commit 4dbcf11

Please sign in to comment.