The Linear Topic Map format, LTM (https://ontopia.net/download/ltm.html), allows specification of networks in a human-readable format.

qna_to_tlm(
  x,
  topicmapId = "rock_qna_topicmap",
  topicmapTitle = "A ROCK QNA Topic Map"
)

Arguments

x

The parsed source object (as produced by parse_source()), or an object holding multiple parsed sources (as produced by parse_sources()).

topicmapId, topicmapTitle

The topic map's identifier and title.

Value

If x is a single parsed source: a character vector holding the Linear Topic Map specification; or, if multiple network coding schemes were used in parallel, each in a list. If x contains multiple parseds sources, a list of such objects (i.e., a list of vectors, or a list of lists of vectors).

Examples

### Get path to example source
examplePath <-
  system.file("extdata", package="rock");

### Read a souce coded with the Qualitative Network Approach
qnaExample <-
  rock::parse_source(
    file.path(
      examplePath,
      "network-example-1.rock"
    )
  );

### Convert and show the topic map
cat(
  rock::qna_to_tlm(
    qnaExample
  ),
  sep="\n"
);
#> #VERSION "1.3"
#> #TOPICMAP ~ rock_qna_topicmap
#> 
#> [rock_qna_topicmap = "A ROCK QNA Topic Map"]
#> {rock_qna_topicmap, creation-date, [[2024-01-21]]}
#> 
#> /* topics */
#> 
#> [tired]
#> [cranky]
#> [hungry]
#> [cheerful]
#> [coffee]
#> [weather]
#> [warmWeather]
#> 
#> /* association types */
#> 
#> [causal_pos]
#> [structural]
#> [causal_neg]
#> [causal]
#> 
#> /* associations */
#> 
#> causal_pos(tired, cranky)
#> structural(cranky, mood)
#> causal_pos(hungry, cranky)
#> structural(cheerful, mood)
#> causal_pos(coffee, cheerful)
#> structural(coffee, drug)
#> causal_neg(coffee, tired)
#> causal(weather, mood)
#> causal(weather, hungry)
#> structural(warmWeather, weather)
#> causal_neg(warmWeather, hungry)
#> 
#> /* end */