Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

Raw File Download

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
content badge
swh:1:cnt:3963f00c60086437e3348fffdc128e8773deba55

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
(requires biblatex-software package)
Generating citation ...
#include "macrovsa.hpp"
#include "time.hpp"
using namespace macrovsa;

/* Experiment corresponding to the (Viéville & Mercier 2024) draft
 * @param {bool} [with_RDFSS = true] Defines if we add extra RDFSs supplementary inferences.
 * @param {double} [tau_eat = 1] Defines if exact (tau_eat = 1) or approximate (tau_eat = 0.5) inference on eating.
 * @param {String} [trace = "ado"] Level of trace as defined Rules.hpp.
 */
void small_pizza_experiment(double tau_eat = 1, String trace = "ado")
{
  class SomeRules: public Rules {
public:
    SomeRules(String trace) : Rules(0, trace) {
      // ClassInheritance
      Rule_2(rdfs9,
             // getTau()
             return algo::conj(algo::sim(predicate_1, "rdf:type"), algo::sim(object_1, subject_2), algo::sim(predicate_2, "rdfs:subClassOf"));
             ,
             // setOutput()
             output.add(*subject_1, tau, "rdf:type", *object_2);
             );
    }
  }
  someRules(trace);

  // Defines incoming facts
  RelationalMap incoming("Luigi pizza incoming facts");
  incoming.add("Luigi", tau_eat, "eats", "thisPizza");
  incoming.add("eats", "rdfs:domain", "Person");
  incoming.add("eats", "rdfs:range", "Food");
  incoming.add("thisPizza", "rdf:type", "MagheritaPizza");
  incoming.add("thisPizza", "hasTopping", "thisMozzarella");
  incoming.add("MagheritaPizza", "rdfs:subClassOf", "Pizza");
  incoming.add("Pizza", "rdfs:subClassOf", "Food");
  incoming.add("hasTopping", "rdfs:subPropertyOf", "hasIngredient");
  incoming.add("MagheritaPizza", "hasTopping", "Tomato");

  // Runs inference
  RelationalMap infered("Luigi pizza infered facts");
  aidesys::now(false, false);
  someRules.apply(infered, incoming);
  printf("Calculus duration in msec : %.3f\n", aidesys::now(false, true));
  printf("%s\n", infered.asString().c_str());
}
int main()
{
  small_pizza_experiment(1, "ado");
  small_pizza_experiment(0.5, "");
  return 0;
}

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API