Martin van Harmelen (Triply Support) - TriplyDB

Martin van Harmelen (Triply Support)

martin
Member since Nov 2nd, 2020
Administrator
Groups

GoodRelations is a standardized vocabulary (also known as “schema”, “data dictionary”, or “ontology”) for product, price, store, and company data that can (1) be embedded into existing static and dynamic Web pages and that (2) can be processed by other computers. This increases the visibility of your products and services in the latest generation of search engines, recommender systems, and other novel applications.

Version: 1.0.0

Commerce
Vocabulary
Economy
Semantics

numbers

Public

The first 50000 natural numbers:

#! /usr/bin/env python3
"""
Generate the natural numbers in turtle format.
"""
from argparse import ArgumentParser

ARGV_OVERRIDE = None
# ARGV_OVERRIDE = ["10"]

HEADER = """
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
""".strip()
LINE_FORMAT = '<http://dbpedia.org/resource/{number}_(number)> rdf:value' \
    '"{number}"^^xsd:positiveInteger .'

parser = ArgumentParser(description=__doc__)
parser.add_argument(
    "n",
    help="Number of positive integers to calculate",
    type=int)

n = parser.parse_args(ARGV_OVERRIDE).n

print(HEADER)
for i in range(1, n + 1):
    print(LINE_FORMAT.format(number=i))