[RDF] CVS update
Jonas Liljegren
jonas@rit.se
20 Oct 2000 10:27:50 +0200
Hello! :-) I have started to implement the API I have described.
I start with minimal implementations, without any support for expanded
criterions. The API text has been updated to be more general. In
summary:
Elements in [] are ORed together and pairs in {} are ANDed together.
The special props { and => [...] } and { or => {} } changes that
behaviour. { not => [...] } and { not => {...} } negates the effect
of [] and {}.
The current CVS version has implemented rev_type(), arc_subj() and
list() with the background support of init_rev_types(),
init_rev_props(), declare_selection() and declare_add_rev_types().
The other methods will be replaced shortly. I have realy only replaced
the first row in the template code below.
I have updated the debug output. It's now easier to follow what's
happens internally. This is what happens if you, in the test program,
lists the two persons. This is the TT code:
[% persons = s.get("${NS_L}/Class#Person").rev_type.list %]
<table>
[% FOREACH person = persons %]
<tr>
<td>[% person.get_objects_list("${NS_L}/Property#first_name").0.value %]
<td>[% person.get_objects_list("${NS_L}/Property#last_name").0.value %]
<td><input type="button" OnClick="f.r_person.value='$person.uri'; go('person_view')" value=" View ">
<td><input type="button" OnClick="f.r_person.value='$person.uri'; go('person_edit_form')" value=" Edit ">
<td><input type="button" OnClick="f.r_person.value='$person.uri'; go('person_list', 'person_delete')" value=" Delete ">
</tr>
[% END %]
</table>
The program starts by connecting to the interfaces. We are using two
DBI interfaces in order to see how well it works with information
distributed over several sources:
our $s = new RDF::Service( NS_L."/service/R1" );
$s->connect("RDF::Service::Interface::Schema::RDFS_200001");
our $ia = $s->connect("RDF::Service::Interface::DBI::V01",
{
connect => "dbi:Pg:dbname=wraf_v01a",
name => "wwwdata",
});
our $ib = $s->connect("RDF::Service::Interface::DBI::V01",
{
connect => "dbi:Pg:dbname=wraf_v01b",
name => "wwwdata",
});
And here is the debug output (using verbose level 1). The '0' and '1'
numbers to the left of the method name indicates which interface is
being called. The number a bit to the right of the method name is a
counter to see how many times a certan method is called. The first
row under the method name row states the resource making the call.
Additional rows will indicate the parameters to the method.
/~~ new RDF::Service 1
| /~~ declare_model 1
| | http://uxn.nu/rdf/2000/09/19/local/service/R1
| | /~~ declare_add_types 1
| | | http://uxn.nu/rdf/2000/09/19/local/service/R1/20001020T100827-001
| | \__ declare_add_types
| \__ declare_model
| Bootstrap
| Registring RDF/Service/Interface/Base/V01.pm
\__ new RDF::Service
Conneting to the schema
/~~ 0 connect 1
| http://uxn.nu/rdf/2000/09/19/local/service/R1
| Registring RDF/Service/Interface/Schema/RDFS_200001.pm
\__ 0 connect
/~~ 0 connect 2
| http://uxn.nu/rdf/2000/09/19/local/service/R1
| Registring RDF/Service/Interface/DBI/V01.pm
\__ 0 connect
/~~ 0 connect 3
| http://uxn.nu/rdf/2000/09/19/local/service/R1
| Registring RDF/Service/Interface/DBI/V01.pm
\__ 0 connect
/~~ rev_type 1
| http://uxn.nu/rdf/2000/09/19/local/Class#Person
| /~~ 0 init_types 1
| | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | Types for http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | ..http://www.w3.org/2000/01/rdf-schema#Resource
| \__ 0 init_types
| /~~ 1 init_types 2
| | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | /~~ declare_add_types 2
| | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | Resetting the jumptable for http://uxn.nu/rdf/2000/09/19/local/Class#Person: --no value--
| | \__ declare_add_types
| | Types for http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | ..http://www.w3.org/2000/01/rdf-schema#Class
| | ..http://www.w3.org/2000/01/rdf-schema#Resource
| \__ 1 init_types
| /~~ 0 init_rev_types 1
| | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | /~~ declare_add_rev_types 1
| | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | Adding http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | | ..Finding implicit rev_types
| | | /~~ arc_subj 1
| | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | ( http://www.w3.org/2000/01/rdf-schema#subClassOf )
| | | | /~~ 0 init_rev_props 1
| | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | | Fetching rev_props
| | | | \__ 0 init_rev_props
| | | | /~~ 1 init_rev_props 2
| | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | | Fetching rev_props
| | | | \__ 1 init_rev_props
| | | | /~~ declare_selection 1
| | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | | ( )
| | | | | /~~ declare_add_types 3
| | | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person/20001020T100830-001
| | | | | | /~~ get_objects_list 1
| | | | | | | http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | (http://www.w3.org/2000/01/rdf-schema#subClassOf)
| | | | | | | /~~ 0 init_types 3
| | | | | | | | http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | | Types for http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | | ..http://www.w3.org/2000/01/rdf-schema#Resource
| | | | | | | \__ 0 init_types
| | | | | | | /~~ 1 init_types 4
| | | | | | | | http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | | Types for http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | | ..http://www.w3.org/2000/01/rdf-schema#Resource
| | | | | | | \__ 1 init_types
| | | | | | | /~~ 0 init_props 1
| | | | | | | | http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | | Fetching props
| | | | | | | \__ 0 init_props
| | | | | | | /~~ 1 init_props 2
| | | | | | | | http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | | Fetching props
| | | | | | | \__ 1 init_props
| | | | | | \__ get_objects_list
| | | | | \__ declare_add_types
| | | | \__ declare_selection
| | | \__ arc_subj
| | | Returning a list of 0 resources
| | | ..Finding done
| | \__ declare_add_rev_types
| | /~~ declare_add_rev_types 2
| | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | Adding http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | | ..Finding implicit rev_types
| | | /~~ arc_subj 2
| | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | ( http://www.w3.org/2000/01/rdf-schema#subClassOf )
| | | | /~~ declare_selection 2
| | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | | ( )
| | | | | /~~ declare_add_types 4
| | | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person/20001020T100830-002
| | | | | | /~~ get_objects_list 2
| | | | | | | http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | | | | (http://www.w3.org/2000/01/rdf-schema#subClassOf)
| | | | | | \__ get_objects_list
| | | | | \__ declare_add_types
| | | | \__ declare_selection
| | | \__ arc_subj
| | | Returning a list of 0 resources
| | | ..Finding done
| | \__ declare_add_rev_types
| \__ 0 init_rev_types
| /~~ 1 init_rev_types 2
| | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| \__ 1 init_rev_types
| /~~ declare_selection 3
| | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | ( http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003 http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003 )
| | /~~ declare_add_types 5
| | | http://uxn.nu/rdf/2000/09/19/local/Class#Person/20001020T100830-003
| | | /~~ get_objects_list 3
| | | | http://uxn.nu/rdf/2000/09/19/local#Selection
| | | | (http://www.w3.org/2000/01/rdf-schema#subClassOf)
| | | \__ get_objects_list
| | \__ declare_add_types
| \__ declare_selection
\__ rev_type
Returning a list of 2 resources
/~~ get_objects_list 4
| http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| (http://uxn.nu/rdf/2000/09/19/local/Property#first_name)
| /~~ 0 init_types 5
| | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | /~~ declare_add_types 6
| | | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | | /~~ get_objects_list 5
| | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | (http://www.w3.org/2000/01/rdf-schema#subClassOf)
| | | | /~~ 0 init_props 3
| | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | | RDFS init_props_class RDF::Service::Resource=ARRAY(0x85fa31c)
| | | | \__ 0 init_props
| | | | /~~ 1 init_props 4
| | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | | Fetching props
| | | | \__ 1 init_props
| | | | /~~ 2 init_props 5
| | | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | | Fetching props
| | | | \__ 2 init_props
| | | \__ get_objects_list
| | | Resetting the jumptable for http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003: --no value--
| | \__ declare_add_types
| | Types for http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | ..http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | ..http://www.w3.org/2000/01/rdf-schema#Resource
| \__ 0 init_types
| /~~ 1 init_types 6
| | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | Types for http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | ..http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | ..http://www.w3.org/2000/01/rdf-schema#Resource
| \__ 1 init_types
| /~~ 0 init_props 6
| | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | Fetching props
| | ..Found a RDF::Service::Resource=ARRAY(0x85d7ce0)
| | /~~ declare_arc 1
| | | http://uxn.nu/rdf/2000/09/19/local#M1
| | | P http://uxn.nu/rdf/2000/09/19/local/Property#first_name
| | | S http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | | O http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| | | /~~ declare_add_types 7
| | | | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003#20001013T103317-003
| | | \__ declare_add_types
| | \__ declare_arc
| | ..Found a RDF::Service::Resource=ARRAY(0x85d2890)
| | /~~ declare_arc 2
| | | http://uxn.nu/rdf/2000/09/19/local#M1
| | | P http://uxn.nu/rdf/2000/09/19/local/Property#last_name
| | | S http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | | O http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| | | /~~ declare_add_types 8
| | | | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003#20001013T103317-004
| | | \__ declare_add_types
| | \__ declare_arc
| \__ 0 init_props
| /~~ 1 init_props 7
| | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| | Fetching props
| \__ 1 init_props
| /~~ 0 obj 1
| | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003#20001013T103317-003
| \__ 0 obj
\__ get_objects_list
/~~ 0 init_types 7
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| /~~ declare_add_types 9
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| | Resetting the jumptable for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004: --no value--
| \__ declare_add_types
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 0 init_types
/~~ 1 init_types 8
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 1 init_types
/~~ 0 value 1
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| /~~ 0 init_props 8
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| | Fetching props
| \__ 0 init_props
| /~~ 1 init_props 9
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-004
| | Fetching props
| \__ 1 init_props
\__ 0 value
/~~ get_objects_list 6
| http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003
| (http://uxn.nu/rdf/2000/09/19/local/Property#last_name)
| /~~ 0 obj 2
| | http://uxn.nu/rdf/2000/09/19/local#20001013T103316-003#20001013T103317-004
| \__ 0 obj
\__ get_objects_list
/~~ 0 init_types 9
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| /~~ declare_add_types 10
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| | Resetting the jumptable for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005: --no value--
| \__ declare_add_types
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 0 init_types
/~~ 1 init_types 10
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 1 init_types
/~~ 0 value 2
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| /~~ 0 init_props 10
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| | Fetching props
| \__ 0 init_props
| /~~ 1 init_props 11
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T103316-005
| | Fetching props
| \__ 1 init_props
\__ 0 value
/~~ get_objects_list 7
| http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| (http://uxn.nu/rdf/2000/09/19/local/Property#first_name)
| /~~ 0 init_types 11
| | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | /~~ declare_add_types 11
| | | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | | /~~ get_objects_list 8
| | | | http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | | | (http://www.w3.org/2000/01/rdf-schema#subClassOf)
| | | \__ get_objects_list
| | | Resetting the jumptable for http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003: --no value--
| | \__ declare_add_types
| | Types for http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | ..http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | ..http://www.w3.org/2000/01/rdf-schema#Resource
| \__ 0 init_types
| /~~ 1 init_types 12
| | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | Types for http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | ..http://uxn.nu/rdf/2000/09/19/local/Class#Person
| | ..http://www.w3.org/2000/01/rdf-schema#Resource
| \__ 1 init_types
| /~~ 0 init_props 12
| | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | Fetching props
| | ..Found a RDF::Service::Resource=ARRAY(0x85d7ce0)
| | /~~ declare_arc 3
| | | http://uxn.nu/rdf/2000/09/19/local#M1
| | | P http://uxn.nu/rdf/2000/09/19/local/Property#first_name
| | | S http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | | O http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| | | /~~ declare_add_types 12
| | | | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003#20001013T102943-003
| | | \__ declare_add_types
| | \__ declare_arc
| | ..Found a RDF::Service::Resource=ARRAY(0x85d2890)
| | /~~ declare_arc 4
| | | http://uxn.nu/rdf/2000/09/19/local#M1
| | | P http://uxn.nu/rdf/2000/09/19/local/Property#last_name
| | | S http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | | O http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| | | /~~ declare_add_types 13
| | | | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003#20001013T102943-004
| | | \__ declare_add_types
| | \__ declare_arc
| \__ 0 init_props
| /~~ 1 init_props 13
| | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| | Fetching props
| \__ 1 init_props
| /~~ 0 obj 3
| | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003#20001013T102943-003
| \__ 0 obj
\__ get_objects_list
/~~ 0 init_types 13
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| /~~ declare_add_types 14
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| | Resetting the jumptable for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004: --no value--
| \__ declare_add_types
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 0 init_types
/~~ 1 init_types 14
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 1 init_types
/~~ 0 value 3
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| /~~ 0 init_props 14
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| | Fetching props
| \__ 0 init_props
| /~~ 1 init_props 15
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-004
| | Fetching props
| \__ 1 init_props
\__ 0 value
/~~ get_objects_list 9
| http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003
| (http://uxn.nu/rdf/2000/09/19/local/Property#last_name)
| /~~ 0 obj 4
| | http://uxn.nu/rdf/2000/09/19/local#20001013T102942-003#20001013T102943-004
| \__ 0 obj
\__ get_objects_list
/~~ 0 init_types 15
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| /~~ declare_add_types 15
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| | Resetting the jumptable for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005: --no value--
| \__ declare_add_types
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 0 init_types
/~~ 1 init_types 16
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| Types for http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| ..http://www.w3.org/2000/01/rdf-schema#Literal
| ..http://www.w3.org/2000/01/rdf-schema#Resource
\__ 1 init_types
/~~ 0 value 4
| http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| /~~ 0 init_props 16
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| | Fetching props
| \__ 0 init_props
| /~~ 1 init_props 17
| | http://uxn.nu/rdf/2000/09/19/local/literal/20001013T102942-005
| | Fetching props
| \__ 1 init_props
\__ 0 value
--
/ Jonas Liljegren
The Wraf project http://www.uxn.nu/wraf/
Sponsored by http://www.rit.se/