mirror of
https://github.com/commons-app/apps-android-commons.git
synced 2025-10-26 20:33:53 +01:00
31 lines
927 B
Kotlin
31 lines
927 B
Kotlin
package org.wikipedia.wikidata
|
|
|
|
import org.wikipedia.wikidata.DataValue.EntityId
|
|
|
|
|
|
data class EditClaim(val claims: List<Statement_partial>) {
|
|
|
|
companion object {
|
|
@JvmStatic
|
|
fun from(entityId: String, propertyName: String) =
|
|
EditClaim(
|
|
listOf(
|
|
Statement_partial(
|
|
Snak_partial(
|
|
"value",
|
|
propertyName,
|
|
EntityId(
|
|
WikiBaseEntityValue(
|
|
"item",
|
|
entityId,
|
|
entityId.removePrefix("Q").toLong()
|
|
)
|
|
)
|
|
),
|
|
"statement",
|
|
"preferred"
|
|
)
|
|
)
|
|
)
|
|
}
|
|
}
|