args_me_model.Claim

pydantic model args_me_model.Claim

A statement that something it true.

Show JSON schema
{
   "title": "Claim",
   "description": "A statement that something it true.",
   "type": "object",
   "properties": {
      "id": {
         "description": "The claim's unique identifier",
         "pattern": "S[0-9a-z]{4}C[0-9a-f]{16}$",
         "title": "Id",
         "type": "string"
      },
      "text": {
         "description": "The claim's text",
         "title": "Text",
         "type": "string"
      },
      "counter": {
         "anyOf": [
            {
               "pattern": "S[0-9a-z]{4}C[0-9a-f]{16}$",
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "description": "ID of the counter claim to this claim",
         "title": "Counter"
      },
      "support": {
         "default": [],
         "description": "Other claims that support this claim as an argument",
         "items": {
            "$ref": "#/$defs/Support"
         },
         "title": "Support",
         "type": "array"
      },
      "sources": {
         "description": "Sources for this claim",
         "items": {
            "$ref": "#/$defs/Source"
         },
         "minItems": 1,
         "title": "Sources",
         "type": "array"
      },
      "annotations": {
         "additionalProperties": {
            "$ref": "#/$defs/JsonValue"
         },
         "default": {},
         "description": "Further data on the claim",
         "title": "Annotations",
         "type": "object"
      }
   },
   "$defs": {
      "JsonValue": {},
      "Source": {
         "description": "The source of a text or support relationship.",
         "properties": {
            "name": {
               "description": "Name of the source (e.g., domain or generation method)",
               "title": "Name",
               "type": "string"
            },
            "text": {
               "anyOf": [
                  {
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "Original text taken from the source",
               "title": "Text"
            },
            "url": {
               "anyOf": [
                  {
                     "format": "uri",
                     "maxLength": 2083,
                     "minLength": 1,
                     "type": "string"
                  },
                  {
                     "type": "null"
                  }
               ],
               "default": null,
               "description": "URL from which the text or support relationship was taken",
               "title": "Url"
            },
            "annotations": {
               "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
               },
               "default": {},
               "description": "Further data on the source",
               "title": "Annotations",
               "type": "object"
            }
         },
         "required": [
            "name"
         ],
         "title": "Source",
         "type": "object"
      },
      "Support": {
         "description": "A list of premises (claims) that, when taken together (\"linked\"), support\nsome conclusion (another claim).",
         "properties": {
            "premises": {
               "description": "IDs of the claims that provide linked support for the conclusion",
               "items": {
                  "pattern": "S[0-9a-z]{4}C[0-9a-f]{16}$",
                  "type": "string"
               },
               "minItems": 1,
               "title": "Premises",
               "type": "array"
            },
            "sources": {
               "description": "Sources for this support relation",
               "items": {
                  "$ref": "#/$defs/Source"
               },
               "minItems": 1,
               "title": "Sources",
               "type": "array"
            },
            "annotations": {
               "additionalProperties": {
                  "$ref": "#/$defs/JsonValue"
               },
               "default": {},
               "description": "Further data on the support relation",
               "title": "Annotations",
               "type": "object"
            }
         },
         "required": [
            "premises",
            "sources"
         ],
         "title": "Support",
         "type": "object"
      }
   },
   "required": [
      "id",
      "text",
      "sources"
   ]
}

Fields:
  • annotations (Dict[str, JsonValue])

  • counter (str | None)

  • id (str)

  • sources (List[args_me_model.source.Source])

  • support (List[args_me_model.support.Support])

  • text (str)

Validators:
  • _validate_sources » sources

field annotations: Dict[str, JsonValue] = {}

Further data on the claim

field counter: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='S[0-9a-z]{4}C[0-9a-f]{16}$')])] | None = None

ID of the counter claim to this claim

field id: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='S[0-9a-z]{4}C[0-9a-f]{16}$')])] [Required]

The claim’s unique identifier

Constraints:
  • pattern = S[0-9a-z]{4}C[0-9a-f]{16}$

field sources: List[Source] [Required]

Sources for this claim

Constraints:
  • min_length = 1

Validated by:
  • _validate_sources

field support: List[Support] = []

Other claims that support this claim as an argument

field text: str [Required]

The claim’s text

classmethod from_source(source: Source, counter: Claim | None = None, support: List[List[Claim]] = []) Claim

Derive a claim object directly from the source, copying its text.

Parameters:
  • cls – the class object

  • source (Source) – the source object from which the claim should be derived

  • counter (Claim or None) – the (single) counter claim to the claim

  • support (list[list[Claim]]) – a list of linked supports from the same source; each list of claims within the list corresponds to one linked support relation

Returns:

the claim object directly derived from the source

Return type:

Claim

Raises:

ValueError – if the source contains no ‘text’

static read_ndjson(file_name: Annotated[Path, PathType(path_type=file)]) Iterator[Claim]

Read claims from a Newline Delimited JSON file.

Parameters:

file_name (str) – The name of the file to read

Returns:

an iterator over the claims in the file

Return type:

iterator[Claim]

static write_ndjson(claims: Iterator[Claim], file_name: str, mode: Annotated[str, FieldInfo(annotation=NoneType, required=True, metadata=[_PydanticGeneralMetadata(pattern='[awx]')])] = 'w')

Write claims to a Newline Delimited JSON file.

Parameters:
  • claims (iterator[Claim]) – An iterator over the claims to write

  • file_name (str) – The name of the file to write to

  • mode (str) – The mode for writing to the file (“a” for appending), defaults to “w”